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
14771477DESCR ("convert abstime to timestamp with time zone" );
14781478DATA (insert OID = 1174 (timestamptz PGNSP PGUID 12 f f t f s 1 1184 "1082" date_timestamptz - _null_ ));
14791479DESCR ("convert date to timestamp with time zone" );
1480- DATA (insert OID = 1176 (timestamptz PGNSP PGUID 14 f f t f s 2 1184 "1082 1083" "selecttimestamptz( $1 + $2)" - _null_ ));
1480+ DATA (insert OID = 1176 (timestamptz PGNSP PGUID 14 f f t f s 2 1184 "1082 1083" "selectcast(( $1 + $2) as timestamp with time zone )" - _null_ ));
14811481DESCR ("convert date and time to timestamp with time zone" );
14821482DATA (insert OID = 1177 (interval PGNSP PGUID 12 f f t f i 1 1186 "703" reltime_interval - _null_ ));
14831483DESCR ("convert reltime to interval" );
@@ -1520,9 +1520,9 @@ DESCR("date difference preserving months and years");
15201520DATA (insert OID = 1200 (interval PGNSP PGUID 12 f f t f i 2 1186 "1186 23" interval_scale - _null_ ));
15211521DESCR ("adjust interval precision" );
15221522
1523- DATA (insert OID = 1215 (obj_description PGNSP PGUID 14 f f t f s 2 25 "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 (insert OID = 1215 (obj_description PGNSP PGUID 14 f f t f s 2 25 "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_ ));
15241524DESCR ("get description for object id and catalog name" );
1525- DATA (insert OID = 1216 (col_description PGNSP PGUID 14 f f t f s 2 25 "26 23" "select description from pg_description where objoid = $1 and classoid = \'pg_catalog.pg_class\'::regclass and objsubid = $2" - _null_ ));
1525+ DATA (insert OID = 1216 (col_description PGNSP PGUID 14 f f t f s 2 25 "26 23" "select description frompg_catalog. pg_description where objoid = $1 and classoid = \'pg_catalog.pg_class\'::regclass and objsubid = $2" - _null_ ));
15261526DESCR ("get description for table column" );
15271527
15281528DATA (insert OID = 1217 (date_trunc PGNSP PGUID 12 f f t f i 2 1184 "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 (insert OID = 1348 (obj_description PGNSP PGUID 14 f f t f s 1 25 "26" "select description from pg_description where objoid = $1 and objsubid = 0" - _null_ ));
1686+ DATA (insert OID = 1348 (obj_description PGNSP PGUID 14 f f t f s 1 25 "26" "select description frompg_catalog. pg_description where objoid = $1 and objsubid = 0" - _null_ ));
16871687DESCR ("get description for object id (deprecated)" );
16881688DATA (insert OID = 1349 (oidvectortypes PGNSP PGUID 12 f f t f s 1 25 "30" oidvectortypes - _null_ ));
16891689DESCR ("print type names of oidvector field" );
@@ -1740,15 +1740,15 @@ DESCR("smaller of two");
17401740DATA (insert OID = 1381 (char_length PGNSP PGUID 12 f f t f i 1 23 "25" textlen - _null_ ));
17411741DESCR ("character length" );
17421742
1743- DATA (insert OID = 1382 (date_part PGNSP PGUID 14 f f t f s 2 701 "25 702" "select date_part($1,timestamptz ($2))" - _null_ ));
1743+ DATA (insert OID = 1382 (date_part PGNSP PGUID 14 f f t f s 2 701 "25 702" "selectpg_catalog. date_part($1,cast ($2 as timestamp with time zone ))" - _null_ ));
17441744DESCR ("extract field from abstime" );
1745- DATA (insert OID = 1383 (date_part PGNSP PGUID 14 f f t f s 2 701 "25 703" "select date_part($1, cast($2 as interval))" - _null_ ));
1745+ DATA (insert OID = 1383 (date_part PGNSP PGUID 14 f f t f s 2 701 "25 703" "selectpg_catalog. date_part($1, cast($2 aspg_catalog. interval))" - _null_ ));
17461746DESCR ("extract field from reltime" );
1747- DATA (insert OID = 1384 (date_part PGNSP PGUID 14 f f t f i 2 701 "25 1082" "select date_part($1, cast($2 as timestamp without time zone))" - _null_ ));
1747+ DATA (insert OID = 1384 (date_part PGNSP PGUID 14 f f t f i 2 701 "25 1082" "selectpg_catalog. date_part($1, cast($2 as timestamp without time zone))" - _null_ ));
17481748DESCR ("extract field from date" );
17491749DATA (insert OID = 1385 (date_part PGNSP PGUID 12 f f t f i 2 701 "25 1083" time_part - _null_ ));
17501750DESCR ("extract field from time" );
1751- DATA (insert OID = 1386 (age PGNSP PGUID 14 f f t f s 1 1186 "1184" "select age(cast(current_date as timestamp with time zone), $1)" - _null_ ));
1751+ DATA (insert OID = 1386 (age PGNSP PGUID 14 f f t f s 1 1186 "1184" "selectpg_catalog. age(cast(current_date as timestamp with time zone), $1)" - _null_ ));
17521752DESCR ("date difference from today preserving months and years" );
17531753
17541754DATA (insert OID = 1388 (timetz PGNSP PGUID 12 f f t f s 1 1266 "1184" timestamptz_timetz - _null_ ));
@@ -1789,9 +1789,9 @@ DESCR("current schema name");
17891789DATA (insert OID = 1403 (current_schemas PGNSP PGUID 12 f f t f s 1 1003 "16" current_schemas - _null_ ));
17901790DESCR ("current schema search list" );
17911791
1792- DATA (insert OID = 1404 (overlay PGNSP PGUID 14 f f t f i 4 25 "25 25 23 23" "select substring($1, 1, ($3 - 1)) || $2 || substring($1, ($3 + $4))" - _null_ ));
1792+ DATA (insert OID = 1404 (overlay PGNSP PGUID 14 f f t f i 4 25 "25 25 23 23" "selectpg_catalog. substring($1, 1, ($3 - 1)) || $2 ||pg_catalog. substring($1, ($3 + $4))" - _null_ ));
17931793DESCR ("substitute portion of string" );
1794- DATA (insert OID = 1405 (overlay PGNSP PGUID 14 f f t f i 3 25 "25 25 23" "select substring($1, 1, ($3 - 1)) || $2 || substring($1, ($3 + char_length($2)))" - _null_ ));
1794+ DATA (insert OID = 1405 (overlay PGNSP PGUID 14 f f t f i 3 25 "25 25 23" "selectpg_catalog. substring($1, 1, ($3 - 1)) || $2 ||pg_catalog. substring($1, ($3 +pg_catalog. char_length($2)))" - _null_ ));
17951795DESCR ("substitute portion of string" );
17961796
17971797DATA (insert OID = 1406 (isvertical PGNSP PGUID 12 f f t f i 2 16 "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
18351835DESCR ("multiply box by point (scale)" );
18361836DATA (insert OID = 1425 (box_div PGNSP PGUID 12 f f t f i 2 603 "603 600" box_div - _null_ ));
18371837DESCR ("divide box by point (scale)" );
1838- DATA (insert OID = 1426 (path_contain_pt PGNSP PGUID 14 f f t f i 2 16 "602 600" "select on_ppath($2, $1)" - _null_ ));
1838+ DATA (insert OID = 1426 (path_contain_pt PGNSP PGUID 14 f f t f i 2 16 "602 600" "selectpg_catalog. on_ppath($2, $1)" - _null_ ));
18391839DESCR ("path contains point?" );
18401840DATA (insert OID = 1428 (poly_contain_pt PGNSP PGUID 12 f f t f i 2 16 "604 600" poly_contain_pt - _null_ ));
18411841DESCR ("polygon contains point?" );
@@ -2015,7 +2015,7 @@ DATA(insert OID = 1542 ( centerPGNSP PGUID 12 f f t f i 1 600 "603"box_cent
20152015DESCR ("center of" );
20162016DATA (insert OID = 1543 (center PGNSP PGUID 12 f f t f i 1 600 "718" circle_center - _null_ ));
20172017DESCR ("center of" );
2018- DATA (insert OID = 1544 (polygon PGNSP PGUID 14 f f t f i 1 604 "718" "select polygon(12, $1)" - _null_ ));
2018+ DATA (insert OID = 1544 (polygon PGNSP PGUID 14 f f t f i 1 604 "718" "selectpg_catalog. polygon(12, $1)" - _null_ ));
20192019DESCR ("convert circle to 12-vertex polygon" );
20202020DATA (insert OID = 1545 (npoints PGNSP PGUID 12 f f t f i 1 23 "602" path_npoints - _null_ ));
20212021DESCR ("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
21652165DESCR ("return portion of string" );
21662166DATA (insert OID = 878 (translate PGNSP PGUID 12 f f t f i 3 25 "25 25 25" translate - _null_ ));
21672167DESCR ("map a set of character appearing in string" );
2168- DATA (insert OID = 879 (lpad PGNSP PGUID 14 f f t f i 2 25 "25 23" "select lpad($1, $2, \' \')" - _null_ ));
2168+ DATA (insert OID = 879 (lpad PGNSP PGUID 14 f f t f i 2 25 "25 23" "selectpg_catalog. lpad($1, $2, \' \')" - _null_ ));
21692169DESCR ("left-pad string to length" );
2170- DATA (insert OID = 880 (rpad PGNSP PGUID 14 f f t f i 2 25 "25 23" "select rpad($1, $2, \' \')" - _null_ ));
2170+ DATA (insert OID = 880 (rpad PGNSP PGUID 14 f f t f i 2 25 "25 23" "selectpg_catalog. rpad($1, $2, \' \')" - _null_ ));
21712171DESCR ("right-pad string to length" );
21722172DATA (insert OID = 881 (ltrim PGNSP PGUID 12 f f t f i 1 25 "25" ltrim1 - _null_ ));
21732173DESCR ("trim spaces from left end of string" );
@@ -2315,7 +2315,7 @@ DESCR("adjust varbit() to typmod length");
23152315
23162316DATA (insert OID = 1698 (position PGNSP PGUID 12 f f t f i 2 23 "1560 1560" bitposition - _null_ ));
23172317DESCR ("return position of sub-bitstring" );
2318- DATA (insert OID = 1699 (substring PGNSP PGUID 14 f f t f i 2 1560 "1560 23" "select substring($1, $2, -1)" - _null_ ));
2318+ DATA (insert OID = 1699 (substring PGNSP PGUID 14 f f t f i 2 1560 "1560 23" "selectpg_catalog. substring($1, $2, -1)" - _null_ ));
23192319DESCR ("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
24452445DESCR ("sign of value" );
24462446DATA (insert OID = 1707 (round PGNSP PGUID 12 f f t f i 2 1700 "1700 23" numeric_round - _null_ ));
24472447DESCR ("value rounded to 'scale'" );
2448- DATA (insert OID = 1708 (round PGNSP PGUID 14 f f t f i 1 1700 "1700" "select round($1,0)" - _null_ ));
2448+ DATA (insert OID = 1708 (round PGNSP PGUID 14 f f t f i 1 1700 "1700" "selectpg_catalog. round($1,0)" - _null_ ));
24492449DESCR ("value rounded to 'scale' of zero" );
24502450DATA (insert OID = 1709 (trunc PGNSP PGUID 12 f f t f i 2 1700 "1700 23" numeric_trunc - _null_ ));
24512451DESCR ("value truncated to 'scale'" );
2452- DATA (insert OID = 1710 (trunc PGNSP PGUID 14 f f t f i 1 1700 "1700" "select trunc($1,0)" - _null_ ));
2452+ DATA (insert OID = 1710 (trunc PGNSP PGUID 14 f f t f i 1 1700 "1700" "selectpg_catalog. trunc($1,0)" - _null_ ));
24532453DESCR ("value truncated to 'scale' of zero" );
24542454DATA (insert OID = 1711 (ceil PGNSP PGUID 12 f f t f i 1 1700 "1700" numeric_ceil - _null_ ));
24552455DESCR ("smallest integer >= value" );
@@ -2501,7 +2501,7 @@ DATA(insert OID = 1739 ( numeric_powerPGNSP PGUID 12 f f t f i 2 1700 "1700 1
25012501DESCR ("m raised to the power of n" );
25022502DATA (insert OID = 1740 (numeric PGNSP PGUID 12 f f t f i 1 1700 "23" int4_numeric - _null_ ));
25032503DESCR ("(internal)" );
2504- DATA (insert OID = 1741 (log PGNSP PGUID 14 f f t f i 1 1700 "1700" "select log(10, $1)" - _null_ ));
2504+ DATA (insert OID = 1741 (log PGNSP PGUID 14 f f t f i 1 1700 "1700" "selectpg_catalog. log(10, $1)" - _null_ ));
25052505DESCR ("logarithm base 10 of n" );
25062506DATA (insert OID = 1742 (numeric PGNSP PGUID 12 f f t f i 1 1700 "700" float4_numeric - _null_ ));
25072507DESCR ("(internal)" );
@@ -2575,11 +2575,11 @@ DATA(insert OID = 1799 ( oidout PGNSP PGUID 12 f f t f i 1 2275 "26" oidout
25752575DESCR ("I/O" );
25762576
25772577
2578- DATA (insert OID = 1810 (bit_length PGNSP PGUID 14 f f t f i 1 23 "17" "select octet_length($1) * 8" - _null_ ));
2578+ DATA (insert OID = 1810 (bit_length PGNSP PGUID 14 f f t f i 1 23 "17" "selectpg_catalog. octet_length($1) * 8" - _null_ ));
25792579DESCR ("length in bits" );
2580- DATA (insert OID = 1811 (bit_length PGNSP PGUID 14 f f t f i 1 23 "25" "select octet_length($1) * 8" - _null_ ));
2580+ DATA (insert OID = 1811 (bit_length PGNSP PGUID 14 f f t f i 1 23 "25" "selectpg_catalog. octet_length($1) * 8" - _null_ ));
25812581DESCR ("length in bits" );
2582- DATA (insert OID = 1812 (bit_length PGNSP PGUID 14 f f t f i 1 23 "1560" "select length($1)" - _null_ ));
2582+ DATA (insert OID = 1812 (bit_length PGNSP PGUID 14 f f t f i 1 23 "1560" "selectpg_catalog. length($1)" - _null_ ));
25832583DESCR ("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
29362936DESCR ("greater-than" );
29372937DATA (insert OID = 2058 (age PGNSP PGUID 12 f f t f i 2 1186 "1114 1114" timestamp_age - _null_ ));
29382938DESCR ("date difference preserving months and years" );
2939- DATA (insert OID = 2059 (age PGNSP PGUID 14 f f t f s 1 1186 "1114" "select age(cast(current_date as timestamp without time zone), $1)" - _null_ ));
2939+ DATA (insert OID = 2059 (age PGNSP PGUID 14 f f t f s 1 1186 "1114" "selectpg_catalog. age(cast(current_date as timestamp without time zone), $1)" - _null_ ));
29402940DESCR ("date difference from today preserving months and years" );
29412941
29422942DATA (insert OID = 2069 (timezone PGNSP PGUID 12 f f t f s 2 1184 "25 1114" timestamp_zone - _null_ ));
@@ -2950,7 +2950,7 @@ DESCR("subtract");
29502950
29512951DATA (insert OID = 2073 (substring PGNSP PGUID 12 f f t f i 2 25 "25 25" textregexsubstr - _null_ ));
29522952DESCR ("extracts text matching regular expression" );
2953- DATA (insert OID = 2074 (substring PGNSP PGUID 14 f f t f i 3 25 "25 25 25" "select substring($1, similar_escape($2, $3))" - _null_ ));
2953+ DATA (insert OID = 2074 (substring PGNSP PGUID 14 f f t f i 3 25 "25 25 25" "selectpg_catalog. substring($1,pg_catalog. similar_escape($2, $3))" - _null_ ));
29542954DESCR ("extracts text matching SQL99 regular expression" );
29552955
29562956DATA (insert OID = 2075 (bit PGNSP PGUID 12 f f t f i 1 1560 "20" bitfromint8 - _null_ ));