Skip to content

Commit 1fa5da4

Browse files
committed
_pgr_prim deprecated internal function: SQL removal, C NOTICE raised about deprecation
1 parent c4cd95c commit 1fa5da4

File tree

5 files changed

+15
-41
lines changed

5 files changed

+15
-41
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ milestone for 4.0.0
6060
* _pgr_dijkstra(text,anyarray,anyarray,boolean,boolean,boolean,bigint)
6161
* _pgr_dijkstra(text,text,boolean,boolean,boolean)
6262
* _pgr_drivingdistance(text,anyarray,double precision,boolean,boolean)
63+
* _pgr_prim(text,anyarray,text,bigint,double precision)
6364
* _pgr_trsp(text,integer,double precision,integer,double precision,boolean,boolean,text)
6465
* _pgr_trsp(text,text,anyarray,anyarray,boolean)
6566
* _pgr_trsp(text,text,anyarray,bigint,boolean)
@@ -74,6 +75,7 @@ milestone for 4.0.0
7475
**Deprecation of internal C/C++ functions**
7576

7677
* _pgr_drivingdistance(text,anyarray,double precision,boolean,boolean)
78+
* _pgr_prim(text,anyarray,text,bigint,double precision)
7779

7880
**Internal C/C++ functions in legacy**
7981

doc/src/release_notes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ milestone for 4.0.0
9191
* _pgr_dijkstra(text,anyarray,anyarray,boolean,boolean,boolean,bigint)
9292
* _pgr_dijkstra(text,text,boolean,boolean,boolean)
9393
* _pgr_drivingdistance(text,anyarray,double precision,boolean,boolean)
94+
* _pgr_prim(text,anyarray,text,bigint,double precision)
9495
* _pgr_trsp(text,integer,double precision,integer,double precision,boolean,boolean,text)
9596
* _pgr_trsp(text,text,anyarray,anyarray,boolean)
9697
* _pgr_trsp(text,text,anyarray,bigint,boolean)
@@ -105,6 +106,7 @@ milestone for 4.0.0
105106
.. rubric:: Deprecation of internal C/C++ functions
106107

107108
* _pgr_drivingdistance(text,anyarray,double precision,boolean,boolean)
109+
* _pgr_prim(text,anyarray,text,bigint,double precision)
108110

109111
.. rubric:: Internal C/C++ functions in legacy
110112

sql/sigs/pgrouting--4.0.sig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ pgr_primdd(text,bigint,numeric)
245245
pgr_primdfs(text,anyarray,bigint)
246246
pgr_primdfs(text,bigint,bigint)
247247
pgr_prim(text)
248-
_pgr_prim(text,anyarray,text,bigint,double precision)
249248
_pgr_primv4(text,anyarray,text,bigint,double precision)
250249
pgr_pushrelabel(text,anyarray,anyarray)
251250
pgr_pushrelabel(text,anyarray,bigint)

sql/spanningTree/_prim.sql

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2727
2828
********************************************************************PGR-GNU*/
2929

30-
----------
31-
----------
32-
-- mst
33-
----------
34-
----------
35-
36-
37-
----------------
38-
-- _pgr_prim
39-
----------------
40-
41-
4230
--v3.7
4331
CREATE FUNCTION _pgr_primv4(
4432
TEXT, -- Edge sql
@@ -61,30 +49,3 @@ LANGUAGE C VOLATILE STRICT;
6149

6250
COMMENT ON FUNCTION _pgr_primv4(TEXT, ANYARRAY, TEXT, BIGINT, FLOAT)
6351
IS 'pgRouting internal function';
64-
65-
--v3.0
66-
CREATE FUNCTION _pgr_prim(
67-
TEXT, -- Edge sql
68-
ANYARRAY, -- tree root for traversal
69-
order_by TEXT,
70-
max_depth BIGINT,
71-
distance FLOAT,
72-
73-
OUT seq BIGINT,
74-
OUT depth BIGINT,
75-
OUT start_vid BIGINT,
76-
OUT node BIGINT,
77-
OUT edge BIGINT,
78-
OUT cost FLOAT,
79-
OUT agg_cost FLOAT)
80-
RETURNS SETOF RECORD AS
81-
'MODULE_PATHNAME'
82-
LANGUAGE C VOLATILE STRICT;
83-
84-
85-
-- COMMENTS
86-
87-
88-
COMMENT ON FUNCTION _pgr_prim(TEXT, ANYARRAY, TEXT, BIGINT, FLOAT)
89-
IS 'pgRouting internal function deprecated on v3.7.0';
90-

src/spanningTree/prim.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,11 @@ PGDLLEXPORT Datum _pgr_primv4(PG_FUNCTION_ARGS) {
171171
}
172172
}
173173

174-
/******************************************************************************/
174+
/* Deprecated code starts here
175+
* This code is used on v3.6 and under
176+
*
177+
* TODO(v5) Move to legacy
178+
*/
175179

176180
PGDLLEXPORT Datum _pgr_prim(PG_FUNCTION_ARGS);
177181
PG_FUNCTION_INFO_V1(_pgr_prim);
@@ -183,6 +187,12 @@ PGDLLEXPORT Datum _pgr_prim(PG_FUNCTION_ARGS) {
183187
MST_rt *result_tuples = NULL;
184188
size_t result_count = 0;
185189

190+
ereport(NOTICE, (
191+
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
192+
errmsg("A stored procedure is using deprecated C internal function '%s'", __func__),
193+
errdetail("Library function '%s' was deprecated in pgRouting %s", __func__, "3.7.0"),
194+
errhint("Consider upgrade pgRouting")));
195+
186196
if (SRF_IS_FIRSTCALL()) {
187197
MemoryContext oldcontext;
188198
funcctx = SRF_FIRSTCALL_INIT();

0 commit comments

Comments
 (0)