Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2b23bf3

Browse files
committed
Fix built-in SQL-language functions to ensure that referenced names
are properly schema-qualified.Christopher Kings-Lynne
1 parentd4273a5 commit2b23bf3

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

‎src/include/catalog/catversion.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
3838
* Portions Copyright (c) 1994, Regents of the University of California
3939
*
40-
* $Id: catversion.h,v 1.209 2003/10/20 21:39:37 petere Exp $
40+
* $Id: catversion.h,v 1.210 2003/10/21 16:23:16 tgl Exp $
4141
*
4242
*-------------------------------------------------------------------------
4343
*/
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/*yyyymmddN */
56-
#defineCATALOG_VERSION_NO200310201
56+
#defineCATALOG_VERSION_NO200310211
5757

5858
#endif

‎src/include/catalog/pg_proc.h

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: pg_proc.h,v 1.313 2003/08/17 19:58:06 tgl Exp $
10+
* $Id: pg_proc.h,v 1.314 2003/10/21 16:23:16 tgl Exp $
1111
*
1212
* NOTES
1313
* The script catalog/genbki.sh reads this file and generates .bki
@@ -1477,7 +1477,7 @@ DATA(insert OID = 1173 ( timestamptz PGNSP PGUID 12 f f t f s 1 1184 "702"a
14771477
DESCR("convert abstime to timestamp with time zone");
14781478
DATA(insertOID=1174 (timestamptzPGNSPPGUID12fftfs11184"1082"date_timestamptz-_null_ ));
14791479
DESCR("convert date to timestamp with time zone");
1480-
DATA(insertOID=1176 (timestamptzPGNSPPGUID14fftfs21184"1082 1083""selecttimestamptz($1 + $2)"-_null_ ));
1480+
DATA(insertOID=1176 (timestamptzPGNSPPGUID14fftfs21184"1082 1083""selectcast(($1 + $2) as timestamp with time zone)"-_null_ ));
14811481
DESCR("convert date and time to timestamp with time zone");
14821482
DATA(insertOID=1177 (intervalPGNSPPGUID12fftfi11186"703"reltime_interval-_null_ ));
14831483
DESCR("convert reltime to interval");
@@ -1520,9 +1520,9 @@ DESCR("date difference preserving months and years");
15201520
DATA(insertOID=1200 (intervalPGNSPPGUID12fftfi21186"1186 23"interval_scale-_null_ ));
15211521
DESCR("adjust interval precision");
15221522

1523-
DATA(insertOID=1215 (obj_descriptionPGNSPPGUID14fftfs225"26 19""select description from pg_description where objoid = $1 and classoid = (select oid from pg_class where relname = $2 and relnamespace = PGNSP) and objsubid = 0"-_null_ ));
1523+
DATA(insertOID=1215 (obj_descriptionPGNSPPGUID14fftfs225"26 19""select description frompg_catalog.pg_description where objoid = $1 and classoid = (select oid frompg_catalog.pg_class where relname = $2 and relnamespace = PGNSP) and objsubid = 0"-_null_ ));
15241524
DESCR("get description for object id and catalog name");
1525-
DATA(insertOID=1216 (col_descriptionPGNSPPGUID14fftfs225"26 23""select description from pg_description where objoid = $1 and classoid = \'pg_catalog.pg_class\'::regclass and objsubid = $2"-_null_ ));
1525+
DATA(insertOID=1216 (col_descriptionPGNSPPGUID14fftfs225"26 23""select description frompg_catalog.pg_description where objoid = $1 and classoid = \'pg_catalog.pg_class\'::regclass and objsubid = $2"-_null_ ));
15261526
DESCR("get description for table column");
15271527

15281528
DATA(insertOID=1217 (date_truncPGNSPPGUID12fftfi21184"25 1184"timestamptz_trunc-_null_ ));
@@ -1683,7 +1683,7 @@ DESCR("exponential");
16831683
* This form of obj_description is now deprecated, since it will fail if
16841684
* OIDs are not unique across system catalogs.Use the other forms instead.
16851685
*/
1686-
DATA(insertOID=1348 (obj_descriptionPGNSPPGUID14fftfs125"26""select description from pg_description where objoid = $1 and objsubid = 0"-_null_ ));
1686+
DATA(insertOID=1348 (obj_descriptionPGNSPPGUID14fftfs125"26""select description frompg_catalog.pg_description where objoid = $1 and objsubid = 0"-_null_ ));
16871687
DESCR("get description for object id (deprecated)");
16881688
DATA(insertOID=1349 (oidvectortypesPGNSPPGUID12fftfs125"30"oidvectortypes-_null_ ));
16891689
DESCR("print type names of oidvector field");
@@ -1740,15 +1740,15 @@ DESCR("smaller of two");
17401740
DATA(insertOID=1381 (char_lengthPGNSPPGUID12fftfi123"25"textlen-_null_ ));
17411741
DESCR("character length");
17421742

1743-
DATA(insertOID=1382 (date_partPGNSPPGUID14fftfs2701"25 702""select date_part($1,timestamptz($2))"-_null_ ));
1743+
DATA(insertOID=1382 (date_partPGNSPPGUID14fftfs2701"25 702""selectpg_catalog.date_part($1,cast($2 as timestamp with time zone))"-_null_ ));
17441744
DESCR("extract field from abstime");
1745-
DATA(insertOID=1383 (date_partPGNSPPGUID14fftfs2701"25 703""select date_part($1, cast($2 as interval))"-_null_ ));
1745+
DATA(insertOID=1383 (date_partPGNSPPGUID14fftfs2701"25 703""selectpg_catalog.date_part($1, cast($2 aspg_catalog.interval))"-_null_ ));
17461746
DESCR("extract field from reltime");
1747-
DATA(insertOID=1384 (date_partPGNSPPGUID14fftfi2701"25 1082""select date_part($1, cast($2 as timestamp without time zone))"-_null_ ));
1747+
DATA(insertOID=1384 (date_partPGNSPPGUID14fftfi2701"25 1082""selectpg_catalog.date_part($1, cast($2 as timestamp without time zone))"-_null_ ));
17481748
DESCR("extract field from date");
17491749
DATA(insertOID=1385 (date_partPGNSPPGUID12fftfi2701"25 1083"time_part-_null_ ));
17501750
DESCR("extract field from time");
1751-
DATA(insertOID=1386 (agePGNSPPGUID14fftfs11186"1184""select age(cast(current_date as timestamp with time zone), $1)"-_null_ ));
1751+
DATA(insertOID=1386 (agePGNSPPGUID14fftfs11186"1184""selectpg_catalog.age(cast(current_date as timestamp with time zone), $1)"-_null_ ));
17521752
DESCR("date difference from today preserving months and years");
17531753

17541754
DATA(insertOID=1388 (timetzPGNSPPGUID12fftfs11266"1184"timestamptz_timetz-_null_ ));
@@ -1789,9 +1789,9 @@ DESCR("current schema name");
17891789
DATA(insertOID=1403 (current_schemasPGNSPPGUID12fftfs11003"16"current_schemas-_null_ ));
17901790
DESCR("current schema search list");
17911791

1792-
DATA(insertOID=1404 (overlayPGNSPPGUID14fftfi425"25 25 23 23""select substring($1, 1, ($3 - 1)) || $2 || substring($1, ($3 + $4))"-_null_ ));
1792+
DATA(insertOID=1404 (overlayPGNSPPGUID14fftfi425"25 25 23 23""selectpg_catalog.substring($1, 1, ($3 - 1)) || $2 ||pg_catalog.substring($1, ($3 + $4))"-_null_ ));
17931793
DESCR("substitute portion of string");
1794-
DATA(insertOID=1405 (overlayPGNSPPGUID14fftfi325"25 25 23""select substring($1, 1, ($3 - 1)) || $2 || substring($1, ($3 + char_length($2)))"-_null_ ));
1794+
DATA(insertOID=1405 (overlayPGNSPPGUID14fftfi325"25 25 23""selectpg_catalog.substring($1, 1, ($3 - 1)) || $2 ||pg_catalog.substring($1, ($3 +pg_catalog.char_length($2)))"-_null_ ));
17951795
DESCR("substitute portion of string");
17961796

17971797
DATA(insertOID=1406 (isverticalPGNSPPGUID12fftfi216"600 600"point_vert-_null_ ));
@@ -1835,7 +1835,7 @@ DATA(insert OID = 1424 ( box_mulPGNSP PGUID 12 f f t f i 2 603 "603 600"box
18351835
DESCR("multiply box by point (scale)");
18361836
DATA(insertOID=1425 (box_divPGNSPPGUID12fftfi2603"603 600"box_div-_null_ ));
18371837
DESCR("divide box by point (scale)");
1838-
DATA(insertOID=1426 (path_contain_ptPGNSPPGUID14fftfi216"602 600""select on_ppath($2, $1)"-_null_ ));
1838+
DATA(insertOID=1426 (path_contain_ptPGNSPPGUID14fftfi216"602 600""selectpg_catalog.on_ppath($2, $1)"-_null_ ));
18391839
DESCR("path contains point?");
18401840
DATA(insertOID=1428 (poly_contain_ptPGNSPPGUID12fftfi216"604 600"poly_contain_pt-_null_ ));
18411841
DESCR("polygon contains point?");
@@ -2015,7 +2015,7 @@ DATA(insert OID = 1542 ( centerPGNSP PGUID 12 f f t f i 1 600 "603"box_cent
20152015
DESCR("center of");
20162016
DATA(insertOID=1543 (centerPGNSPPGUID12fftfi1600"718"circle_center-_null_ ));
20172017
DESCR("center of");
2018-
DATA(insertOID=1544 (polygonPGNSPPGUID14fftfi1604"718""select polygon(12, $1)"-_null_ ));
2018+
DATA(insertOID=1544 (polygonPGNSPPGUID14fftfi1604"718""selectpg_catalog.polygon(12, $1)"-_null_ ));
20192019
DESCR("convert circle to 12-vertex polygon");
20202020
DATA(insertOID=1545 (npointsPGNSPPGUID12fftfi123"602"path_npoints-_null_ ));
20212021
DESCR("number of points in path");
@@ -2165,9 +2165,9 @@ DATA(insert OID = 877 ( substr PGNSP PGUID 12 f f t f i 3 25 "25 23 23" te
21652165
DESCR("return portion of string");
21662166
DATA(insertOID=878 (translatePGNSPPGUID12fftfi325"25 25 25"translate-_null_ ));
21672167
DESCR("map a set of character appearing in string");
2168-
DATA(insertOID=879 (lpadPGNSPPGUID14fftfi225"25 23""select lpad($1, $2, \' \')"-_null_ ));
2168+
DATA(insertOID=879 (lpadPGNSPPGUID14fftfi225"25 23""selectpg_catalog.lpad($1, $2, \' \')"-_null_ ));
21692169
DESCR("left-pad string to length");
2170-
DATA(insertOID=880 (rpadPGNSPPGUID14fftfi225"25 23""select rpad($1, $2, \' \')"-_null_ ));
2170+
DATA(insertOID=880 (rpadPGNSPPGUID14fftfi225"25 23""selectpg_catalog.rpad($1, $2, \' \')"-_null_ ));
21712171
DESCR("right-pad string to length");
21722172
DATA(insertOID=881 (ltrimPGNSPPGUID12fftfi125"25"ltrim1-_null_ ));
21732173
DESCR("trim spaces from left end of string");
@@ -2315,7 +2315,7 @@ DESCR("adjust varbit() to typmod length");
23152315

23162316
DATA(insertOID=1698 (positionPGNSPPGUID12fftfi223"1560 1560"bitposition-_null_ ));
23172317
DESCR("return position of sub-bitstring");
2318-
DATA(insertOID=1699 (substringPGNSPPGUID14fftfi21560"1560 23""select substring($1, $2, -1)"-_null_ ));
2318+
DATA(insertOID=1699 (substringPGNSPPGUID14fftfi21560"1560 23""selectpg_catalog.substring($1, $2, -1)"-_null_ ));
23192319
DESCR("return portion of bitstring");
23202320

23212321

@@ -2445,11 +2445,11 @@ DATA(insert OID = 1706 ( signPGNSP PGUID 12 f f t f i 1 1700 "1700"numeric
24452445
DESCR("sign of value");
24462446
DATA(insertOID=1707 (roundPGNSPPGUID12fftfi21700"1700 23"numeric_round-_null_ ));
24472447
DESCR("value rounded to 'scale'");
2448-
DATA(insertOID=1708 (roundPGNSPPGUID14fftfi11700"1700""select round($1,0)"-_null_ ));
2448+
DATA(insertOID=1708 (roundPGNSPPGUID14fftfi11700"1700""selectpg_catalog.round($1,0)"-_null_ ));
24492449
DESCR("value rounded to 'scale' of zero");
24502450
DATA(insertOID=1709 (truncPGNSPPGUID12fftfi21700"1700 23"numeric_trunc-_null_ ));
24512451
DESCR("value truncated to 'scale'");
2452-
DATA(insertOID=1710 (truncPGNSPPGUID14fftfi11700"1700""select trunc($1,0)"-_null_ ));
2452+
DATA(insertOID=1710 (truncPGNSPPGUID14fftfi11700"1700""selectpg_catalog.trunc($1,0)"-_null_ ));
24532453
DESCR("value truncated to 'scale' of zero");
24542454
DATA(insertOID=1711 (ceilPGNSPPGUID12fftfi11700"1700"numeric_ceil-_null_ ));
24552455
DESCR("smallest integer >= value");
@@ -2501,7 +2501,7 @@ DATA(insert OID = 1739 ( numeric_powerPGNSP PGUID 12 f f t f i 2 1700 "1700 1
25012501
DESCR("m raised to the power of n");
25022502
DATA(insertOID=1740 (numericPGNSPPGUID12fftfi11700"23"int4_numeric-_null_ ));
25032503
DESCR("(internal)");
2504-
DATA(insertOID=1741 (logPGNSPPGUID14fftfi11700"1700""select log(10, $1)"-_null_ ));
2504+
DATA(insertOID=1741 (logPGNSPPGUID14fftfi11700"1700""selectpg_catalog.log(10, $1)"-_null_ ));
25052505
DESCR("logarithm base 10 of n");
25062506
DATA(insertOID=1742 (numericPGNSPPGUID12fftfi11700"700"float4_numeric-_null_ ));
25072507
DESCR("(internal)");
@@ -2575,11 +2575,11 @@ DATA(insert OID = 1799 ( oidout PGNSP PGUID 12 f f t f i 1 2275 "26" oidout
25752575
DESCR("I/O");
25762576

25772577

2578-
DATA(insertOID=1810 (bit_lengthPGNSPPGUID14fftfi123"17""select octet_length($1) * 8"-_null_ ));
2578+
DATA(insertOID=1810 (bit_lengthPGNSPPGUID14fftfi123"17""selectpg_catalog.octet_length($1) * 8"-_null_ ));
25792579
DESCR("length in bits");
2580-
DATA(insertOID=1811 (bit_lengthPGNSPPGUID14fftfi123"25""select octet_length($1) * 8"-_null_ ));
2580+
DATA(insertOID=1811 (bit_lengthPGNSPPGUID14fftfi123"25""selectpg_catalog.octet_length($1) * 8"-_null_ ));
25812581
DESCR("length in bits");
2582-
DATA(insertOID=1812 (bit_lengthPGNSPPGUID14fftfi123"1560""select length($1)"-_null_ ));
2582+
DATA(insertOID=1812 (bit_lengthPGNSPPGUID14fftfi123"1560""selectpg_catalog.length($1)"-_null_ ));
25832583
DESCR("length in bits");
25842584

25852585
/* Selectivity estimators for LIKE and related operators */
@@ -2936,7 +2936,7 @@ DATA(insert OID = 2057 ( timestamp_gtPGNSP PGUID 12 f f t f i 2 16 "1114 1114
29362936
DESCR("greater-than");
29372937
DATA(insertOID=2058 (agePGNSPPGUID12fftfi21186"1114 1114"timestamp_age-_null_ ));
29382938
DESCR("date difference preserving months and years");
2939-
DATA(insertOID=2059 (agePGNSPPGUID14fftfs11186"1114""select age(cast(current_date as timestamp without time zone), $1)"-_null_ ));
2939+
DATA(insertOID=2059 (agePGNSPPGUID14fftfs11186"1114""selectpg_catalog.age(cast(current_date as timestamp without time zone), $1)"-_null_ ));
29402940
DESCR("date difference from today preserving months and years");
29412941

29422942
DATA(insertOID=2069 (timezonePGNSPPGUID12fftfs21184"25 1114"timestamp_zone-_null_ ));
@@ -2950,7 +2950,7 @@ DESCR("subtract");
29502950

29512951
DATA(insertOID=2073 (substringPGNSPPGUID12fftfi225"25 25"textregexsubstr-_null_ ));
29522952
DESCR("extracts text matching regular expression");
2953-
DATA(insertOID=2074 (substringPGNSPPGUID14fftfi325"25 25 25""select substring($1, similar_escape($2, $3))"-_null_ ));
2953+
DATA(insertOID=2074 (substringPGNSPPGUID14fftfi325"25 25 25""selectpg_catalog.substring($1,pg_catalog.similar_escape($2, $3))"-_null_ ));
29542954
DESCR("extracts text matching SQL99 regular expression");
29552955

29562956
DATA(insertOID=2075 (bitPGNSPPGUID12fftfi11560"20"bitfromint8-_null_ ));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp