diff --git a/NEWS.md b/NEWS.md index bc8e66321f4..2a6849a2097 100644 --- a/NEWS.md +++ b/NEWS.md @@ -16,16 +16,31 @@ milestone for 4.0.0 Summary of changes by function -* pgr_contraction +* pgr_aStar - * Breaking change, signatures no longer available: - * pgr_contraction(text,bigint[],integer,bigint[],boolean) + * Combinations signature promoted to official. + +* pgr_aStarCost + + * Combinations signature promoted to official. + +* pgr_bdAstar + + * Combinations signature promoted to official. + +* pgr_bdAstarCost + + * Combinations signature promoted to official. * pgr_bdDijkstra * Output columns standardized to ``(seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost)`` * Combinations signature promoted to official. +* pgr_bdDijkstraCost + + * Combinations signature promoted to official. + * pgr_bellmanFord * Output columns standardized to ``(seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost)`` @@ -34,14 +49,44 @@ Summary of changes by function * Output columns standardized to ``(seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost)`` -* pgr_edwardMoore +* pgr_contraction + + .. Breaking change + * Breaking change, signatures no longer available: + * pgr_contraction(text,bigint[],integer,bigint[],boolean) + +* pgr_dagShortestPath * Output columns standardized to ``(seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost)`` -* pgr_DAGshortestPath +* pgr_dijkstra + + * Combinations signature promoted to official. + +* pgr_dijkstraCost + + * Combinations signature promoted to official. + +* pgr_edgeColoring + + * Output columns standardized to ``(edge, color)`` + +* pgr_edwardMoore * Output columns standardized to ``(seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost)`` +* pgr_KSP + + * All signatures promoted to official. + +* pgr_maxFlow + + * Combinations signature promoted to official. + +* pgr_pushRelabel + + * Combinations signature promoted to official. + * pgr_trsp * Function promoted to official. @@ -53,6 +98,7 @@ Summary of changes by function * pgr_trspVia * Function promoted to official. + .. Breaking change * Breaking change, signatures no longer available: * pgr_trspviavertices(text,anyarray,boolean,boolean,text) @@ -147,17 +193,17 @@ Functions promoted to official pgr_trspVia_withPoints * [#2701](https://github.com/pgRouting/pgrouting/issues/2701) pgr_trsp_withPoints -* [#2905](https://github.com/pgRouting/pgrouting/issues/2905) +* [#2700](https://github.com/pgRouting/pgrouting/issues/2700) pgr_withPoints -* [#2905](https://github.com/pgRouting/pgrouting/issues/2905) +* [#2700](https://github.com/pgRouting/pgrouting/issues/2700) pgr_withPointsCost -* [#2905](https://github.com/pgRouting/pgrouting/issues/2905) +* [#2700](https://github.com/pgRouting/pgrouting/issues/2700) pgr_withPointsCostMatrix -* [#2905](https://github.com/pgRouting/pgrouting/issues/2905) +* [#2700](https://github.com/pgRouting/pgrouting/issues/2700) pgr_withPointsDD -* [#2905](https://github.com/pgRouting/pgrouting/issues/2905) +* [#2700](https://github.com/pgRouting/pgrouting/issues/2700) pgr_withPointsKSP -* [#2905](https://github.com/pgRouting/pgrouting/issues/2905) +* [#2700](https://github.com/pgRouting/pgrouting/issues/2700) pgr_withPointsVia Signatures promoted to official @@ -216,6 +262,11 @@ Standardize output columns of functions with different output columns within ove * [#2905](https://github.com/pgRouting/pgrouting/issues/2905) pgr_withPointsCostMatrix +**Standardized to ``(edge, color)``** + +* [#2924](https://github.com/pgRouting/pgrouting/issues/2924) + pgr_edgeColoring + Removal of SQL deprecated signatures * [#2798](https://github.com/pgRouting/pgrouting/issues/2798): @@ -228,6 +279,10 @@ Removal of SQL deprecated signatures * pgr_trsp(text,integer,integer,boolean,boolean,text) * pgr_trsp(text,integer,double precision,integer,double precision,boolean,boolean,text) +* [#2683](https://github.com/pgRouting/pgrouting/issues/2683): pgr_trspVia + + * pgr_trspviavertices(text,anyarray,boolean,boolean,text) + * [#2700](https://github.com/pgRouting/pgrouting/issues/2700): pgr_withPointsVia @@ -385,9 +440,6 @@ Summary of functions and signatures no longer on pgrouting * #2919 pgr_withpoints(text,text,text,boolean,character,boolean) * #2919 pgr_withpointsvia(text,text,anyarray,boolean,boolean,boolean,character,boolean) -**Internal functions** - - Code enhancements * Removal of unused C/C++ code diff --git a/doc/coloring/coloring-family.rst b/doc/coloring/coloring-family.rst index 38014ae0d45..496e600ab8e 100644 --- a/doc/coloring/coloring-family.rst +++ b/doc/coloring/coloring-family.rst @@ -49,37 +49,37 @@ Coloring - Family of functions Result columns ------------------------------------------------------------------------------- -.. result columns start +.. result-edge-color-start -Returns set of ``(vertex_id, color_id)`` +Returns set of |result_edge_color| =============== =========== ====================================== Column Type Description =============== =========== ====================================== -``vertex_id`` ``BIGINT`` Identifier of the vertex. -``color_id`` ``BIGINT`` Identifier of the color of the vertex. +``edge`` ``BIGINT`` Identifier of the edge. +``color`` ``BIGINT`` Color of the edge. - The minimum value of color is 1. =============== =========== ====================================== -.. result columns end +.. result-edge-color-end -.. result columns start edgeColoring +.. result columns start -Returns set of ``(edge_id, color_id)`` +Returns set of ``(vertex_id, color_id)`` -=============== =========== ===================================== +=============== =========== ====================================== Column Type Description -=============== =========== ===================================== -``edge_id`` ``BIGINT`` Identifier of the edge. -``color_id`` ``BIGINT`` Identifier of the color of the edge. +=============== =========== ====================================== +``vertex_id`` ``BIGINT`` Identifier of the vertex. +``color_id`` ``BIGINT`` Identifier of the color of the vertex. - The minimum value of color is 1. -=============== =========== ===================================== +=============== =========== ====================================== -.. result columns end edgeColoring +.. result columns end See Also ------------------------------------------------------------------------------- diff --git a/doc/coloring/pgr_edgeColoring.rst b/doc/coloring/pgr_edgeColoring.rst index b4968f9f63b..b6a3c30ef33 100644 --- a/doc/coloring/pgr_edgeColoring.rst +++ b/doc/coloring/pgr_edgeColoring.rst @@ -25,9 +25,13 @@ graphs .. rubric:: Availability -* Version 3.3.0 +.. rubric:: Version 4.0.0 - * New experimental function. +* Output columns standardized to |result_edge_color| + +.. rubric:: Version 3.3.0 + +* New experimental function. Description ------------------------------------------------------------------------------- @@ -77,7 +81,7 @@ Signatures | pgr_edgeColoring(`Edges SQL`_) - | Returns set of |result-edge-color| + | Returns set of |result_edge_color| | OR EMPTY SET :Example: Graph coloring of pgRouting :doc:`sampledata` @@ -109,8 +113,8 @@ Result columns ------------------------------------------------------------------------------- .. include:: coloring-family.rst - :start-after: result columns start edgeColoring - :end-before: result columns end edgeColoring + :start-after: result-edge-color-start + :end-before: result-edge-color-end See Also diff --git a/doc/conf.py.in b/doc/conf.py.in index 41a9e7ea5da..cd96132fa3b 100644 --- a/doc/conf.py.in +++ b/doc/conf.py.in @@ -365,7 +365,7 @@ rst_epilog=""" .. |result-1-1-no-seq| replace:: ``(seq, node, edge, cost, agg_cost)`` .. |result-m-1-no-seq| replace:: ``(seq, start_vid, node, edge, cost, agg_cost)`` .. |result-node-color| replace:: ``(vertex_id, color_id)`` -.. |result-edge-color| replace:: ``(edge_id, color_id)`` +.. |result_edge_color| replace:: ``(edge, color)`` .. |result-node| replace:: ``(node)`` .. |result-edge| replace:: ``(edge)`` .. |result-separate| replace:: ``(seq,id,sub_id,geom)`` diff --git a/doc/contraction/pgr_contraction.rst b/doc/contraction/pgr_contraction.rst index 4265fc50c35..999a0122436 100644 --- a/doc/contraction/pgr_contraction.rst +++ b/doc/contraction/pgr_contraction.rst @@ -24,6 +24,8 @@ vertices and edges. .. rubric:: Version 4.0.0 +.. Breaking change + * Breaking change, signatures no longer available: * pgr_contraction(text,bigint[],integer,bigint[],boolean) diff --git a/doc/dijkstra/pgr_dijkstra.rst b/doc/dijkstra/pgr_dijkstra.rst index bcc060aad94..1e001559235 100644 --- a/doc/dijkstra/pgr_dijkstra.rst +++ b/doc/dijkstra/pgr_dijkstra.rst @@ -21,43 +21,43 @@ .. rubric:: Availability -* Version 4.0.0 +.. rubric:: Version 4.0.0 - * Combinations signature promoted to official. +* Combinations signature promoted to official. -* Version 3.5.0 +.. rubric:: Version 3.5.0 - * Standardizing output columns to |short-generic-result| +* Standardizing output columns to |short-generic-result| - * pgr_dijkstra(One to One) added ``start_vid`` and ``end_vid`` columns. - * pgr_dijkstra(One to Many) added ``end_vid`` column. - * pgr_dijkstra(Many to One) added ``start_vid`` column. + * pgr_dijkstra(One to One) added ``start_vid`` and ``end_vid`` columns. + * pgr_dijkstra(One to Many) added ``end_vid`` column. + * pgr_dijkstra(Many to One) added ``start_vid`` column. -* Version 3.1.0 +.. rubric:: Version 3.1.0 - * New proposed signature: +* New proposed signature: - * pgr_dijkstra(Combinations) + * pgr_dijkstra(Combinations) -* Version 3.0.0 +.. rubric:: Version 3.0.0 - * Function promoted to official. +* Function promoted to official. -* Version 2.2.0 +.. rubric:: Version 2.2.0 - * New proposed signatures: +* New proposed signatures: - * pgr_dijkstra(One to Many) - * pgr_dijkstra(Many to One) - * pgr_dijkstra(Many to Many) + * pgr_dijkstra(One to Many) + * pgr_dijkstra(Many to One) + * pgr_dijkstra(Many to Many) -* Version 2.1.0 +.. rubric:: Version 2.1.0 - * Signature change on pgr_dijkstra(One to One) +* Signature change on pgr_dijkstra(One to One) -* Version 2.0.0 +.. rubric:: Version 2.0.0 - * Official function. +* Official function. Description diff --git a/doc/dijkstra/pgr_dijkstraCost.rst b/doc/dijkstra/pgr_dijkstraCost.rst index 5a62232680e..3d86b3881eb 100644 --- a/doc/dijkstra/pgr_dijkstraCost.rst +++ b/doc/dijkstra/pgr_dijkstraCost.rst @@ -23,19 +23,19 @@ algorithm. .. rubric:: Availability -* Version 4.0.0 +.. rubric:: Version 4.0.0 - * Combinations signature promoted to official. +* Combinations signature promoted to official. -* Version 3.1.0 +.. rubric:: Version 3.1.0 - * New proposed signature: +* New proposed signature: - * pgr_dijkstraCost(Combinations) + * pgr_dijkstraCost(Combinations) -* Version 2.2.0 +.. rubric:: Version 2.2.0 - * Official function. +* Official function. Description diff --git a/doc/ksp/pgr_KSP.rst b/doc/ksp/pgr_KSP.rst index 77e6727f17d..c06a048d6f1 100644 --- a/doc/ksp/pgr_KSP.rst +++ b/doc/ksp/pgr_KSP.rst @@ -20,9 +20,9 @@ .. rubric:: Availability -* Version 4.0.0 +.. rubric:: Version 4.0.0 - * All signatures promoted to official. +* All signatures promoted to official. .. rubric:: Version 3.6.0 diff --git a/doc/max_flow/pgr_maxFlow.rst b/doc/max_flow/pgr_maxFlow.rst index 941db194727..b59643fa949 100644 --- a/doc/max_flow/pgr_maxFlow.rst +++ b/doc/max_flow/pgr_maxFlow.rst @@ -21,23 +21,23 @@ source(s) to the targets(s) using the Push Relabel algorithm. .. Rubric:: Availability -* Version 4.0.0 +.. rubric:: Version 4.0.0 - * Combinations signature promoted to official. +* Combinations signature promoted to official. -* Version 3.2.0 +.. rubric:: Version 3.2.0 - * New proposed signature: +* New proposed signature: - * pgr_maxFlow(Combinations) + * pgr_maxFlow(Combinations) -* Version 3.0.0 +.. rubric:: Version 3.0.0 - * Function promoted to official. +* Function promoted to official. -* Version 2.4.0 +.. rubric:: Version 2.4.0 - * New proposed function. +* New proposed function. Description diff --git a/doc/max_flow/pgr_pushRelabel.rst b/doc/max_flow/pgr_pushRelabel.rst index 8b28166ecec..6762a7b31fb 100644 --- a/doc/max_flow/pgr_pushRelabel.rst +++ b/doc/max_flow/pgr_pushRelabel.rst @@ -21,28 +21,28 @@ flow from the sources to the targets using Push Relabel Algorithm. .. Rubric:: Availability -* Version 4.0.0 +.. rubric:: Version 4.0.0 - * Combinations signature promoted to official. +* Combinations signature promoted to official. -* Version 3.2.0 +.. rubric:: Version 3.2.0 - * New proposed signature: +* New proposed signature: - * pgr_pushRelabel(Combinations) + * pgr_pushRelabel(Combinations) -* Version 3.0.0 +.. rubric:: Version 3.0.0 - * Function promoted to official. +* Function promoted to official. -* Version 2.5.0 +.. rubric:: Version 2.5.0 - * Renamed from ``pgr_maxFlowPushRelabel`` - * Function promoted to proposed. +* Renamed from ``pgr_maxFlowPushRelabel`` +* Function promoted to proposed. -* Version 2.3.0 +.. rubric:: Version 2.3.0 - * New experimental function. +* New experimental function. Description diff --git a/doc/src/migration.rst b/doc/src/migration.rst index 6456c24329f..23f37ce70f0 100644 --- a/doc/src/migration.rst +++ b/doc/src/migration.rst @@ -33,6 +33,7 @@ Migration to standardized columns .. |pid-m-1| replace:: ``(seq, path_seq, start_pid, node, edge, cost, agg_cost)`` .. |pid-m-m| replace:: ``(seq, path_seq, start_pid, end_pid, node, edge, cost, agg_cost)`` .. |matrix-pid| replace:: ``(start_pid, end_pid, agg_cost)`` +.. |old-edge-color| replace:: ``(edge_id, color_id)`` There has been an effort to standardize function output columns names and types. @@ -85,6 +86,8 @@ types. - `Migration of single path functions`_ * - .. versionchanged:: 4.0.0 :doc:`pgr_dagShortestPath` [3]_ - `Migration of single path functions`_ + * - .. versionchanged:: 4.0.0 :doc:`pgr_edgeColoring` [3]_ + - `Migration of output column name change`_ * - .. versionchanged:: 4.0.0 :doc:`pgr_edwardMoore` [3]_ - `Migration of single path functions`_ * - .. versionchanged:: 4.0.0 :doc:`pgr_withPoints` [2]_ @@ -837,6 +840,20 @@ To get the old version column names |result-dij-dd-m|: filter out the column :start-after: --drivingdistance4 :end-before: --drivingdistance5 +Migration of output column name change +------------------------------------------------------------------------------- + +.. rubric:: :doc:`pgr_edgeColoring` + +From: |old-edge-color| +To: |result_edge_color| + +Before update: + +* Rename ``edge_id`` to ``edge`` and ``color_id`` to ``color``. +* To get the old version column names: in the ``SELECT`` clause use ``edge AS + edge_id`` and ``color AS color_id`` + Migration of deleted functions +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/doc/src/release_notes.rst b/doc/src/release_notes.rst index e8f84458ff7..6d410561dbb 100644 --- a/doc/src/release_notes.rst +++ b/doc/src/release_notes.rst @@ -50,9 +50,27 @@ milestone for 4.0.0 Summary of changes by function ............................................................................... -* pgr_contraction +* pgr_aStar - .. include:: pgr_contraction.rst + .. include:: pgr_aStar.rst + :start-after: Version 4.0.0 + :end-before: .. rubric + +* pgr_aStarCost + + .. include:: pgr_aStarCost.rst + :start-after: Version 4.0.0 + :end-before: .. rubric + +* pgr_bdAstar + + .. include:: pgr_bdAstar.rst + :start-after: Version 4.0.0 + :end-before: .. rubric + +* pgr_bdAstarCost + + .. include:: pgr_bdAstarCost.rst :start-after: Version 4.0.0 :end-before: .. rubric @@ -62,6 +80,12 @@ Summary of changes by function :start-after: Version 4.0.0 :end-before: .. rubric +* pgr_bdDijkstraCost + + .. include:: pgr_bdDijkstraCost.rst + :start-after: Version 4.0.0 + :end-before: .. rubric + * pgr_bellmanFord .. include:: pgr_bellmanFord.rst @@ -74,15 +98,57 @@ Summary of changes by function :start-after: Version 4.0.0 :end-before: .. rubric +* pgr_contraction + + .. include:: pgr_contraction.rst + :start-after: Version 4.0.0 + :end-before: .. rubric + +* pgr_dagShortestPath + + .. include:: pgr_dagShortestPath.rst + :start-after: Version 4.0.0 + :end-before: .. rubric + +* pgr_dijkstra + + .. include:: pgr_dijkstra.rst + :start-after: Version 4.0.0 + :end-before: .. rubric + +* pgr_dijkstraCost + + .. include:: pgr_dijkstraCost.rst + :start-after: Version 4.0.0 + :end-before: .. rubric + +* pgr_edgeColoring + + .. include:: pgr_edgeColoring.rst + :start-after: Version 4.0.0 + :end-before: .. rubric + * pgr_edwardMoore .. include:: pgr_edwardMoore.rst :start-after: Version 4.0.0 :end-before: .. rubric -* pgr_DAGshortestPath +* pgr_KSP - .. include:: pgr_dagShortestPath.rst + .. include:: pgr_KSP.rst + :start-after: Version 4.0.0 + :end-before: .. rubric + +* pgr_maxFlow + + .. include:: pgr_maxFlow.rst + :start-after: Version 4.0.0 + :end-before: .. rubric + +* pgr_pushRelabel + + .. include:: pgr_pushRelabel.rst :start-after: Version 4.0.0 :end-before: .. rubric @@ -157,17 +223,17 @@ Functions promoted to official pgr_trspVia_withPoints * `#2701 `__ pgr_trsp_withPoints -* `#2905 `__ +* `#2700 `__ pgr_withPoints -* `#2905 `__ +* `#2700 `__ pgr_withPointsCost -* `#2905 `__ +* `#2700 `__ pgr_withPointsCostMatrix -* `#2905 `__ +* `#2700 `__ pgr_withPointsDD -* `#2905 `__ +* `#2700 `__ pgr_withPointsKSP -* `#2905 `__ +* `#2700 `__ pgr_withPointsVia Signatures promoted to official @@ -228,6 +294,11 @@ Standardize output columns of functions with different output columns within ove * `#2905 `__ pgr_withPointsCostMatrix +.. rubric:: Standardized to |result_edge_color| + +* `#2924 `__ + pgr_edgeColoring + Removal of SQL deprecated signatures ............................................................................... @@ -244,6 +315,12 @@ Removal of SQL deprecated signatures :start-after: Breaking change :end-before: .. rubric +* `#2683 `__: pgr_trspVia + + .. include:: pgr_trspVia.rst + :start-after: Breaking change + :end-before: .. rubric + * `#2700 `__: pgr_withPointsVia @@ -413,9 +490,6 @@ Summary of functions and signatures no longer on pgrouting * #2919 pgr_withpoints(text,text,text,boolean,character,boolean) * #2919 pgr_withpointsvia(text,text,anyarray,boolean,boolean,boolean,character,boolean) -.. rubric:: Internal functions - - Code enhancements ............................................................................... diff --git a/doc/trsp/pgr_trspVia.rst b/doc/trsp/pgr_trspVia.rst index 2a41c09c6b2..2cd8686c4ed 100644 --- a/doc/trsp/pgr_trspVia.rst +++ b/doc/trsp/pgr_trspVia.rst @@ -25,6 +25,9 @@ .. rubric:: Version 4.0.0 * Function promoted to official. + +.. Breaking change + * Breaking change, signatures no longer available: * pgr_trspviavertices(text,anyarray,boolean,boolean,text) diff --git a/docqueries/coloring/edgeColoring.pg b/docqueries/coloring/edgeColoring.pg index 05eab075a46..fffac77baca 100644 --- a/docqueries/coloring/edgeColoring.pg +++ b/docqueries/coloring/edgeColoring.pg @@ -1,7 +1,7 @@ -- CopyRight(c) pgRouting developers -- Creative Commons Attribution-Share Alike 3.0 License : https://creativecommons.org/licenses/by-sa/3.0/ /* -- q1 */ -SELECT * FROM pgr_edgeColoring( +SELECT edge, color FROM pgr_edgeColoring( 'SELECT id, source, target, cost, reverse_cost FROM edges ORDER BY id' ); diff --git a/docqueries/coloring/edgeColoring.result b/docqueries/coloring/edgeColoring.result index 1ef28de82b3..c9ccaa0c1f3 100644 --- a/docqueries/coloring/edgeColoring.result +++ b/docqueries/coloring/edgeColoring.result @@ -3,30 +3,30 @@ BEGIN SET client_min_messages TO NOTICE; SET /* -- q1 */ -SELECT * FROM pgr_edgeColoring( +SELECT edge, color FROM pgr_edgeColoring( 'SELECT id, source, target, cost, reverse_cost FROM edges ORDER BY id' ); - edge_id | color_id ----------+---------- - 1 | 3 - 2 | 2 - 3 | 3 - 4 | 4 - 5 | 4 - 6 | 1 - 7 | 2 - 8 | 1 - 9 | 2 - 10 | 5 - 11 | 5 - 12 | 3 - 13 | 2 - 14 | 1 - 15 | 3 - 16 | 1 - 17 | 1 - 18 | 1 + edge | color +------+------- + 1 | 3 + 2 | 2 + 3 | 3 + 4 | 4 + 5 | 4 + 6 | 1 + 7 | 2 + 8 | 1 + 9 | 2 + 10 | 5 + 11 | 5 + 12 | 3 + 13 | 2 + 14 | 1 + 15 | 3 + 16 | 1 + 17 | 1 + 18 | 1 (18 rows) /* -- q2 */ diff --git a/pgtap/coloring/edgeColoring/edge_cases.pg b/pgtap/coloring/edgeColoring/edge_cases.pg index abda973d113..90168b59058 100644 --- a/pgtap/coloring/edgeColoring/edge_cases.pg +++ b/pgtap/coloring/edgeColoring/edge_cases.pg @@ -20,16 +20,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. BEGIN; UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); -SELECT CASE WHEN NOT min_version('3.3.0') THEN plan(1) ELSE plan(29) END; +SELECT CASE WHEN min_version('4.0.0') THEN plan(29) ELSE plan(1) END; CREATE OR REPLACE FUNCTION edge_cases() RETURNS SETOF TEXT AS $BODY$ BEGIN -IF NOT min_version('3.3.0') THEN +IF NOT min_version('4.0.0') THEN RETURN QUERY - SELECT skip(1, 'Function is new on 3.3.0'); + SELECT skip(1, 'pgr_edgecoloring: testing only signatures standardaized in v4.0.0.'); RETURN; END IF; @@ -118,7 +118,7 @@ SELECT set_eq('q5', ); RETURN QUERY -SELECT ok((SELECT count(DISTINCT color_id) <= 3 FROM pgr_edgeColoring('q5')), 'At most three colors are expected'); +SELECT ok((SELECT count(DISTINCT color) <= 3 FROM pgr_edgeColoring('q5')), 'At most three colors are expected'); -- even length cycle test @@ -142,7 +142,7 @@ SELECT set_eq('q6', ); RETURN QUERY -SELECT ok((SELECT count(DISTINCT color_id) <= 3 FROM pgr_edgeColoring('q6')), 'At most three colors are expected'); +SELECT ok((SELECT count(DISTINCT color) <= 3 FROM pgr_edgeColoring('q6')), 'At most three colors are expected'); -- changing the order of the edges will change the number of colors expected @@ -165,7 +165,7 @@ SELECT set_eq('q7', ); RETURN QUERY -SELECT is((SELECT count(DISTINCT color_id)::INTEGER FROM pgr_edgeColoring('q7')), 2, 'Two colors are expected'); +SELECT is((SELECT count(DISTINCT color)::INTEGER FROM pgr_edgeColoring('q7')), 2, 'Two colors are expected'); -- odd length cycle test @@ -200,7 +200,7 @@ SELECT set_eq('q8', ); RETURN QUERY -SELECT is((SELECT count(DISTINCT color_id)::INTEGER FROM pgr_edgeColoring('q8')), 3, 'Three colors are expected'); +SELECT is((SELECT count(DISTINCT color)::INTEGER FROM pgr_edgeColoring('q8')), 3, 'Three colors are expected'); -- 5 vertices cyclic @@ -237,7 +237,7 @@ SELECT set_eq('q9', ); RETURN QUERY -SELECT is((SELECT count(DISTINCT color_id)::INTEGER FROM pgr_edgeColoring('q9')), 3, 'Three colors are expected'); +SELECT is((SELECT count(DISTINCT color)::INTEGER FROM pgr_edgeColoring('q9')), 3, 'Three colors are expected'); -- self loop test @@ -344,7 +344,7 @@ SELECT set_eq('q12', ); RETURN QUERY -SELECT is((SELECT count(DISTINCT color_id)::INTEGER FROM pgr_edgeColoring('q12')), 3, 'Three colors are expected'); +SELECT is((SELECT count(DISTINCT color)::INTEGER FROM pgr_edgeColoring('q12')), 3, 'Three colors are expected'); -- 3 vertices multiple edge @@ -377,7 +377,7 @@ SELECT set_eq('q13', ); RETURN QUERY -SELECT is((SELECT count(DISTINCT color_id)::INTEGER FROM pgr_edgeColoring('q13')), 2, 'Two colors are expected'); +SELECT is((SELECT count(DISTINCT color)::INTEGER FROM pgr_edgeColoring('q13')), 2, 'Two colors are expected'); -- 2 vertices multiple edge @@ -442,7 +442,7 @@ SELECT set_eq('q15', ); RETURN QUERY -SELECT is((SELECT count(DISTINCT color_id)::INTEGER FROM pgr_edgeColoring('q15')), 1, 'One color is required'); +SELECT is((SELECT count(DISTINCT color)::INTEGER FROM pgr_edgeColoring('q15')), 1, 'One color is required'); END; diff --git a/pgtap/coloring/edgeColoring/types_check.pg b/pgtap/coloring/edgeColoring/types_check.pg index 66af32cb862..81f6f6d08e7 100644 --- a/pgtap/coloring/edgeColoring/types_check.pg +++ b/pgtap/coloring/edgeColoring/types_check.pg @@ -19,16 +19,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ********************************************************************PGR-GNU*/ BEGIN; -SELECT CASE WHEN NOT min_version('3.3.0') THEN plan(1) ELSE plan(5) END; +SELECT CASE WHEN NOT min_version('4.0.0') THEN plan(1) ELSE plan(5) END; CREATE OR REPLACE FUNCTION types_check() RETURNS SETOF TEXT AS $BODY$ BEGIN - IF NOT min_version('3.3.0') THEN + IF NOT min_version('4.0.0') THEN RETURN QUERY - SELECT skip(1, 'Function is new on 3.3.0'); + SELECT skip(1, 'pgr_edgecoloring: testing only signatures standardaized in v4.0.0.'); RETURN; END IF; @@ -38,7 +38,7 @@ BEGIN RETURN QUERY SELECT function_args_eq('pgr_edgecoloring', - $$SELECT '{"","edge_id","color_id"}'::TEXT[] $$ + $$SELECT '{"","edge","color"}'::TEXT[] $$ ); RETURN QUERY diff --git a/sql/coloring/edgeColoring.sql b/sql/coloring/edgeColoring.sql index dba895d00b7..708871c1e1a 100644 --- a/sql/coloring/edgeColoring.sql +++ b/sql/coloring/edgeColoring.sql @@ -34,17 +34,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. CREATE FUNCTION pgr_edgeColoring( TEXT, -- edges_sql (required) - OUT edge_id BIGINT, - OUT color_id BIGINT) + OUT edge BIGINT, + OUT color BIGINT) RETURNS SETOF RECORD AS $BODY$ -BEGIN - RETURN QUERY - SELECT a.edge_id, a.color_id - FROM _pgr_edgeColoring(_pgr_get_statement($1)) AS a; -END; + SELECT edge_id, color_id + FROM _pgr_edgeColoring(_pgr_get_statement($1)); $BODY$ -LANGUAGE plpgsql VOLATILE STRICT; +LANGUAGE SQL VOLATILE STRICT; -- COMMENTS diff --git a/sql/scripts/build-extension-update-files.pl b/sql/scripts/build-extension-update-files.pl index f646e17695e..725dace27f9 100755 --- a/sql/scripts/build-extension-update-files.pl +++ b/sql/scripts/build-extension-update-files.pl @@ -279,6 +279,10 @@ sub generate_upgrade_script { push @commands, drop_special_case_function("pgr_dagshortestpath(text,text)"); } + if ($old_minor >= "3.3") { + push @commands, drop_special_case_function("pgr_edgecoloring(text)"); + } + # Row type defined by OUT parameters is different. # Out parameters changed names on v4.0.0 # Experimental functions