From c879693c40efdcf4005a2547229cce5195a85446 Mon Sep 17 00:00:00 2001 From: Abhinav Jain Date: Sun, 30 Jul 2023 03:11:26 +0530 Subject: [PATCH] Fixing Migration Documentation --- doc/src/migration.rst | 37 +++++++++++++++++++++++++++++++ docqueries/src/migration.result | 15 +++++++++++++ docqueries/src/migration.test.sql | 5 +++++ 3 files changed, 57 insertions(+) diff --git a/doc/src/migration.rst b/doc/src/migration.rst index 5ef17ce125..030c1a778c 100644 --- a/doc/src/migration.rst +++ b/doc/src/migration.rst @@ -38,6 +38,43 @@ Migration of functions that add new columns .. contents:: Contents :local: +Migration of ``pgr_withPointsKSP`` +------------------------------------------------------------------------------- + +Starting from `v3.6.0 `__ + +Signatures to be migrated: + +* ``pgr_withPointsKSP`` (`One to One`) + +:Before Migration: + +* Output columns were |old-pid-result| + + * Depending on the overload used, the columns ``start_vid`` and ``end_vid`` + might be missing: + + * ``pgr_withPointsKSP`` (`One to One`) does not have ``start_vid`` and ``end_vid``. + +:Migration: + +* Be aware of the existance of the additional columns. + +* In ``pgr_withPointsKSP`` (`One to One`) + + * ``start_vid`` contains the **start vid** parameter value. + * ``end_vid`` contains the **end vid** parameter value. + +.. literalinclude:: migration.queries + :start-after: --withPointsKSP1 + :end-before: --withPointsKSP1 + +* If needed filter out the added columns, for example: + +.. literalinclude:: migration.queries + :start-after: --astar4 + :end-before: --astar5 + Migration of ``pgr_aStar`` ------------------------------------------------------------------------------- diff --git a/docqueries/src/migration.result b/docqueries/src/migration.result index 391f7f7095..bb7bd96885 100644 --- a/docqueries/src/migration.result +++ b/docqueries/src/migration.result @@ -719,5 +719,20 @@ SELECT seq, path_seq, node, edge, cost, agg_cost FROM pgr_aStar( (6 rows) /* --astar5 */ +/* --withPointsKSP1 */ +SELECT * FROM pgr_aStar( + $$SELECT id, source, target, cost, reverse_cost, x1, y1, x2, y2 FROM edges$$, + 6, 10); + seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost +-----+----------+-----------+---------+------+------+------+---------- + 1 | 1 | 6 | 10 | 6 | 4 | 1 | 0 + 2 | 2 | 6 | 10 | 7 | 8 | 1 | 1 + 3 | 3 | 6 | 10 | 11 | 9 | 1 | 2 + 4 | 4 | 6 | 10 | 16 | 16 | 1 | 3 + 5 | 5 | 6 | 10 | 15 | 3 | 1 | 4 + 6 | 6 | 6 | 10 | 10 | -1 | 0 | 5 +(6 rows) + +/* --withPointsKSP1 */ ROLLBACK; ROLLBACK diff --git a/docqueries/src/migration.test.sql b/docqueries/src/migration.test.sql index 4dbe034314..1c49183753 100644 --- a/docqueries/src/migration.test.sql +++ b/docqueries/src/migration.test.sql @@ -244,3 +244,8 @@ SELECT seq, path_seq, node, edge, cost, agg_cost FROM pgr_aStar( $$SELECT id, source, target, cost, reverse_cost, x1, y1, x2, y2 FROM edges$$, 6, 10); /* --astar5 */ +/* --withPointsKSP1 */ +SELECT * FROM pgr_withPointsKSP( + $$SELECT * FROM edges$$, + 6, 10); +/* --withPointsKSP1 */