From: Tom Lane Date: Thu, 3 Jan 2019 23:38:49 +0000 (-0500) Subject: Use symbolic references for pg_language OIDs in the bootstrap data. X-Git-Tag: REL_12_BETA1~994 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=814c9019aa7b0ce3a4f19415023a256fdd717b20;p=postgresql Use symbolic references for pg_language OIDs in the bootstrap data. This patch teaches genbki.pl to replace pg_language names by OIDs in much the same way as it already does for pg_am names etc, and converts pg_proc.dat to use such symbolic references in the prolang column. Aside from getting rid of a few more magic numbers in the initial catalog data, this means that Gen_fmgrtab.pl no longer needs to read pg_language.dat, since it doesn't have to know the OID of the "internal" language; now it's just looking for the string "internal". No need for a catversion bump, since the contents of postgres.bki don't actually change at all. John Naylor Discussion: https://postgr.es/m/CAJVSVGWtUqxpfAaxS88vEGvi+jKzWZb2EStu5io-UPc4p9rSJg@mail.gmail.com --- diff --git a/doc/src/sgml/bki.sgml b/doc/src/sgml/bki.sgml index 786abb95d4..def63eb615 100644 --- a/doc/src/sgml/bki.sgml +++ b/doc/src/sgml/bki.sgml @@ -409,8 +409,9 @@ that's error-prone and hard to understand, so for frequently-referenced catalogs, genbki.pl provides mechanisms to write symbolic references instead. Currently this is possible for references - to access methods, functions, operators, opclasses, opfamilies, and - types. The rules are as follows: + to access methods, functions, languages, + operators, opclasses, opfamilies, and types. + The rules are as follows: @@ -421,6 +422,7 @@ by attaching BKI_LOOKUP(lookuprule) to the column's definition, where lookuprule is pg_am, pg_proc, + pg_language, pg_operator, pg_opclass, pg_opfamily, or pg_type. BKI_LOOKUP can be attached to columns of diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl index 9be683e287..f45971f358 100644 --- a/src/backend/catalog/genbki.pl +++ b/src/backend/catalog/genbki.pl @@ -178,13 +178,20 @@ my $PG_CATALOG_NAMESPACE = # Build lookup tables for OID macro substitutions and for pg_attribute # copies of pg_type values. -# index access method OID lookup +# access method OID lookup my %amoids; foreach my $row (@{ $catalog_data{pg_am} }) { $amoids{ $row->{amname} } = $row->{oid}; } +# language OID lookup +my %langoids; +foreach my $row (@{ $catalog_data{pg_language} }) +{ + $langoids{ $row->{lanname} } = $row->{oid}; +} + # opclass OID lookup my %opcoids; foreach my $row (@{ $catalog_data{pg_opclass} }) @@ -259,6 +266,7 @@ foreach my $row (@{ $catalog_data{pg_type} }) # Map catalog name to OID lookup. my %lookup_kind = ( pg_am => \%amoids, + pg_language => \%langoids, pg_opclass => \%opcoids, pg_operator => \%operoids, pg_opfamily => \%opfoids, diff --git a/src/backend/utils/Gen_fmgrtab.pl b/src/backend/utils/Gen_fmgrtab.pl index 26b0b07973..cafe40806f 100644 --- a/src/backend/utils/Gen_fmgrtab.pl +++ b/src/backend/utils/Gen_fmgrtab.pl @@ -59,6 +59,8 @@ die "No include path; you must specify -I.\n" if !$include_path; # Note: We pass data file names as arguments and then look for matching # headers to parse the schema from. This is backwards from genbki.pl, # but the Makefile dependencies look more sensible this way. +# We currently only need pg_proc, but retain the possibility of reading +# more than one data file. my %catalogs; my %catalog_data; foreach my $datfile (@input_files) @@ -82,9 +84,6 @@ foreach my $datfile (@input_files) my $FirstGenbkiObjectId = Catalog::FindDefinedSymbol('access/transam.h', $include_path, 'FirstGenbkiObjectId'); -my $INTERNALlanguageId = - Catalog::FindDefinedSymbolFromData($catalog_data{pg_language}, - 'INTERNALlanguageId'); # Collect certain fields from pg_proc.dat. my @fmgr = (); @@ -94,7 +93,7 @@ foreach my $row (@{ $catalog_data{pg_proc} }) my %bki_values = %$row; # Select out just the rows for internal-language procedures. - next if $bki_values{prolang} ne $INTERNALlanguageId; + next if $bki_values{prolang} ne 'internal'; push @fmgr, { diff --git a/src/backend/utils/Makefile b/src/backend/utils/Makefile index 8f3e293b0d..a5251327e2 100644 --- a/src/backend/utils/Makefile +++ b/src/backend/utils/Makefile @@ -31,15 +31,11 @@ generated-header-symlinks: $(top_builddir)/src/include/utils/header-stamp $(top_ $(SUBDIRS:%=%-recursive): fmgr-stamp errcodes.h -FMGR_DATA := $(addprefix $(top_srcdir)/src/include/catalog/,\ - pg_language.dat pg_proc.dat \ - ) - # fmgr-stamp records the last time we ran Gen_fmgrtab.pl. We don't rely on # the timestamps of the individual output files, because the Perl script # won't update them if they didn't change (to avoid unnecessary recompiles). -fmgr-stamp: Gen_fmgrtab.pl $(catalogdir)/Catalog.pm $(FMGR_DATA) $(top_srcdir)/src/include/access/transam.h - $(PERL) -I $(catalogdir) $< -I $(top_srcdir)/src/include/ $(FMGR_DATA) +fmgr-stamp: Gen_fmgrtab.pl $(catalogdir)/Catalog.pm $(top_srcdir)/src/include/catalog/pg_proc.dat $(top_srcdir)/src/include/access/transam.h + $(PERL) -I $(catalogdir) $< -I $(top_srcdir)/src/include/ $(top_srcdir)/src/include/catalog/pg_proc.dat touch $@ errcodes.h: $(top_srcdir)/src/backend/utils/errcodes.txt generate-errcodes.pl diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index 3233888e35..dc48bf822b 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -2257,7 +2257,7 @@ proname => 'justify_days', prorettype => 'interval', proargtypes => 'interval', prosrc => 'interval_justify_days' }, { oid => '1176', descr => 'convert date and time to timestamp with time zone', - proname => 'timestamptz', prolang => '14', provolatile => 's', + proname => 'timestamptz', prolang => 'sql', provolatile => 's', prorettype => 'timestamptz', proargtypes => 'date time', prosrc => 'select cast(($1 + $2) as timestamp with time zone)' }, { oid => '1178', descr => 'convert timestamp with time zone to date', @@ -2310,16 +2310,16 @@ prosrc => 'interval_scale' }, { oid => '1215', descr => 'get description for object id and catalog name', - proname => 'obj_description', prolang => '14', procost => '100', + proname => 'obj_description', prolang => 'sql', procost => '100', provolatile => 's', prorettype => 'text', proargtypes => 'oid name', prosrc => 'select description from pg_catalog.pg_description where objoid = $1 and classoid = (select oid from pg_catalog.pg_class where relname = $2 and relnamespace = PGNSP) and objsubid = 0' }, { oid => '1216', descr => 'get description for table column', - proname => 'col_description', prolang => '14', procost => '100', + proname => 'col_description', prolang => 'sql', procost => '100', provolatile => 's', prorettype => 'text', proargtypes => 'oid int4', prosrc => 'select description from pg_catalog.pg_description where objoid = $1 and classoid = \'pg_catalog.pg_class\'::pg_catalog.regclass and objsubid = $2' }, { oid => '1993', descr => 'get description for object id and shared catalog name', - proname => 'shobj_description', prolang => '14', procost => '100', + proname => 'shobj_description', prolang => 'sql', procost => '100', provolatile => 's', prorettype => 'text', proargtypes => 'oid name', prosrc => 'select description from pg_catalog.pg_shdescription where objoid = $1 and classoid = (select oid from pg_catalog.pg_class where relname = $2 and relnamespace = PGNSP)' }, @@ -2492,13 +2492,13 @@ prosrc => 'hashtidextended' }, { oid => '1296', - proname => 'timedate_pl', prolang => '14', prorettype => 'timestamp', + proname => 'timedate_pl', prolang => 'sql', prorettype => 'timestamp', proargtypes => 'time date', prosrc => 'select ($2 + $1)' }, { oid => '1297', proname => 'datetimetz_pl', prorettype => 'timestamptz', proargtypes => 'date timetz', prosrc => 'datetimetz_timestamptz' }, { oid => '1298', - proname => 'timetzdate_pl', prolang => '14', prorettype => 'timestamptz', + proname => 'timetzdate_pl', prolang => 'sql', prorettype => 'timestamptz', proargtypes => 'timetz date', prosrc => 'select ($2 + $1)' }, { oid => '1299', descr => 'current transaction time', proname => 'now', provolatile => 's', prorettype => 'timestamptz', @@ -2540,17 +2540,17 @@ proargtypes => 'timestamptz timestamptz timestamptz timestamptz', prosrc => 'overlaps_timestamp' }, { oid => '1305', descr => 'intervals overlap?', - proname => 'overlaps', prolang => '14', proisstrict => 'f', + proname => 'overlaps', prolang => 'sql', proisstrict => 'f', provolatile => 's', prorettype => 'bool', proargtypes => 'timestamptz interval timestamptz interval', prosrc => 'select ($1, ($1 + $2)) overlaps ($3, ($3 + $4))' }, { oid => '1306', descr => 'intervals overlap?', - proname => 'overlaps', prolang => '14', proisstrict => 'f', + proname => 'overlaps', prolang => 'sql', proisstrict => 'f', provolatile => 's', prorettype => 'bool', proargtypes => 'timestamptz timestamptz timestamptz interval', prosrc => 'select ($1, $2) overlaps ($3, ($3 + $4))' }, { oid => '1307', descr => 'intervals overlap?', - proname => 'overlaps', prolang => '14', proisstrict => 'f', + proname => 'overlaps', prolang => 'sql', proisstrict => 'f', provolatile => 's', prorettype => 'bool', proargtypes => 'timestamptz interval timestamptz timestamptz', prosrc => 'select ($1, ($1 + $2)) overlaps ($3, $4)' }, @@ -2559,15 +2559,15 @@ proname => 'overlaps', proisstrict => 'f', prorettype => 'bool', proargtypes => 'time time time time', prosrc => 'overlaps_time' }, { oid => '1309', descr => 'intervals overlap?', - proname => 'overlaps', prolang => '14', proisstrict => 'f', + proname => 'overlaps', prolang => 'sql', proisstrict => 'f', prorettype => 'bool', proargtypes => 'time interval time interval', prosrc => 'select ($1, ($1 + $2)) overlaps ($3, ($3 + $4))' }, { oid => '1310', descr => 'intervals overlap?', - proname => 'overlaps', prolang => '14', proisstrict => 'f', + proname => 'overlaps', prolang => 'sql', proisstrict => 'f', prorettype => 'bool', proargtypes => 'time time time interval', prosrc => 'select ($1, $2) overlaps ($3, ($3 + $4))' }, { oid => '1311', descr => 'intervals overlap?', - proname => 'overlaps', prolang => '14', proisstrict => 'f', + proname => 'overlaps', prolang => 'sql', proisstrict => 'f', prorettype => 'bool', proargtypes => 'time interval time time', prosrc => 'select ($1, ($1 + $2)) overlaps ($3, $4)' }, @@ -2645,7 +2645,7 @@ # This form of obj_description is now deprecated, since it will fail if # OIDs are not unique across system catalogs. Use the other form instead. { oid => '1348', descr => 'deprecated, use two-argument form instead', - proname => 'obj_description', prolang => '14', procost => '100', + proname => 'obj_description', prolang => 'sql', procost => '100', provolatile => 's', prorettype => 'text', proargtypes => 'oid', prosrc => 'select description from pg_catalog.pg_description where objoid = $1 and objsubid = 0' }, @@ -2729,7 +2729,7 @@ prosrc => 'textlen' }, { oid => '1384', descr => 'extract field from date', - proname => 'date_part', prolang => '14', prorettype => 'float8', + proname => 'date_part', prolang => 'sql', prorettype => 'float8', proargtypes => 'text date', prosrc => 'select pg_catalog.date_part($1, cast($2 as timestamp without time zone))' }, { oid => '1385', descr => 'extract field from time', @@ -2737,7 +2737,7 @@ prosrc => 'time_part' }, { oid => '1386', descr => 'date difference from today preserving months and years', - proname => 'age', prolang => '14', provolatile => 's', + proname => 'age', prolang => 'sql', provolatile => 's', prorettype => 'interval', proargtypes => 'timestamptz', prosrc => 'select pg_catalog.age(cast(current_date as timestamp with time zone), $1)' }, @@ -2852,7 +2852,7 @@ proname => 'box_div', prorettype => 'box', proargtypes => 'box point', prosrc => 'box_div' }, { oid => '1426', - proname => 'path_contain_pt', prolang => '14', prorettype => 'bool', + proname => 'path_contain_pt', prolang => 'sql', prorettype => 'bool', proargtypes => 'path point', prosrc => 'select pg_catalog.on_ppath($2, $1)' }, { oid => '1428', proname => 'poly_contain_pt', prorettype => 'bool', @@ -3112,7 +3112,7 @@ proname => 'center', prorettype => 'point', proargtypes => 'circle', prosrc => 'circle_center' }, { oid => '1544', descr => 'convert circle to 12-vertex polygon', - proname => 'polygon', prolang => '14', prorettype => 'polygon', + proname => 'polygon', prolang => 'sql', prorettype => 'polygon', proargtypes => 'circle', prosrc => 'select pg_catalog.polygon(12, $1)' }, { oid => '1545', descr => 'number of points', proname => 'npoints', prorettype => 'int4', proargtypes => 'path', @@ -3379,11 +3379,11 @@ proname => 'translate', prorettype => 'text', proargtypes => 'text text text', prosrc => 'translate' }, { oid => '879', descr => 'left-pad string to length', - proname => 'lpad', prolang => '14', prorettype => 'text', + proname => 'lpad', prolang => 'sql', prorettype => 'text', proargtypes => 'text int4', prosrc => 'select pg_catalog.lpad($1, $2, \' \')' }, { oid => '880', descr => 'right-pad string to length', - proname => 'rpad', prolang => '14', prorettype => 'text', + proname => 'rpad', prolang => 'sql', prorettype => 'text', proargtypes => 'text int4', prosrc => 'select pg_catalog.rpad($1, $2, \' \')' }, { oid => '881', descr => 'trim spaces from left end of string', @@ -3968,7 +3968,7 @@ proname => 'inetpl', prorettype => 'inet', proargtypes => 'inet int8', prosrc => 'inetpl' }, { oid => '2631', - proname => 'int8pl_inet', prolang => '14', prorettype => 'inet', + proname => 'int8pl_inet', prolang => 'sql', prorettype => 'inet', proargtypes => 'int8 inet', prosrc => 'select $2 + $1' }, { oid => '2632', proname => 'inetmi_int8', prorettype => 'inet', proargtypes => 'inet int8', @@ -4100,13 +4100,13 @@ proname => 'round', prorettype => 'numeric', proargtypes => 'numeric int4', prosrc => 'numeric_round' }, { oid => '1708', descr => 'value rounded to \'scale\' of zero', - proname => 'round', prolang => '14', prorettype => 'numeric', + proname => 'round', prolang => 'sql', prorettype => 'numeric', proargtypes => 'numeric', prosrc => 'select pg_catalog.round($1,0)' }, { oid => '1709', descr => 'value truncated to \'scale\'', proname => 'trunc', prorettype => 'numeric', proargtypes => 'numeric int4', prosrc => 'numeric_trunc' }, { oid => '1710', descr => 'value truncated to \'scale\' of zero', - proname => 'trunc', prolang => '14', prorettype => 'numeric', + proname => 'trunc', prolang => 'sql', prorettype => 'numeric', proargtypes => 'numeric', prosrc => 'select pg_catalog.trunc($1,0)' }, { oid => '1711', descr => 'nearest integer >= value', proname => 'ceil', prorettype => 'numeric', proargtypes => 'numeric', @@ -4193,7 +4193,7 @@ proname => 'numeric', prorettype => 'numeric', proargtypes => 'int4', prosrc => 'int4_numeric' }, { oid => '1741', descr => 'base 10 logarithm', - proname => 'log', prolang => '14', prorettype => 'numeric', + proname => 'log', prolang => 'sql', prorettype => 'numeric', proargtypes => 'numeric', prosrc => 'select pg_catalog.log(10, $1)' }, { oid => '1742', descr => 'convert float4 to numeric', proname => 'numeric', prorettype => 'numeric', proargtypes => 'float4', @@ -4326,7 +4326,7 @@ proname => 'quote_literal', prorettype => 'text', proargtypes => 'text', prosrc => 'quote_literal' }, { oid => '1285', descr => 'quote a data value for usage in a querystring', - proname => 'quote_literal', prolang => '14', provolatile => 's', + proname => 'quote_literal', prolang => 'sql', provolatile => 's', prorettype => 'text', proargtypes => 'anyelement', prosrc => 'select pg_catalog.quote_literal($1::pg_catalog.text)' }, { oid => '1289', @@ -4335,7 +4335,7 @@ proargtypes => 'text', prosrc => 'quote_nullable' }, { oid => '1290', descr => 'quote a possibly-null data value for usage in a querystring', - proname => 'quote_nullable', prolang => '14', proisstrict => 'f', + proname => 'quote_nullable', prolang => 'sql', proisstrict => 'f', provolatile => 's', prorettype => 'text', proargtypes => 'anyelement', prosrc => 'select pg_catalog.quote_nullable($1::pg_catalog.text)' }, @@ -4374,13 +4374,13 @@ prorettype => 'text', proargtypes => 'text', prosrc => 'text_format_nv' }, { oid => '1810', descr => 'length in bits', - proname => 'bit_length', prolang => '14', prorettype => 'int4', + proname => 'bit_length', prolang => 'sql', prorettype => 'int4', proargtypes => 'bytea', prosrc => 'select pg_catalog.octet_length($1) * 8' }, { oid => '1811', descr => 'length in bits', - proname => 'bit_length', prolang => '14', prorettype => 'int4', + proname => 'bit_length', prolang => 'sql', prorettype => 'int4', proargtypes => 'text', prosrc => 'select pg_catalog.octet_length($1) * 8' }, { oid => '1812', descr => 'length in bits', - proname => 'bit_length', prolang => '14', prorettype => 'int4', + proname => 'bit_length', prolang => 'sql', prorettype => 'int4', proargtypes => 'bit', prosrc => 'select pg_catalog.length($1)' }, # Selectivity estimators for LIKE and related operators @@ -4699,7 +4699,7 @@ prosrc => 'to_ascii_encname' }, { oid => '1848', - proname => 'interval_pl_time', prolang => '14', prorettype => 'time', + proname => 'interval_pl_time', prolang => 'sql', prorettype => 'time', proargtypes => 'interval time', prosrc => 'select $2 + $1' }, { oid => '1850', @@ -5479,11 +5479,11 @@ proargtypes => 'timetz int4', prosrc => 'timetz_scale' }, { oid => '2003', - proname => 'textanycat', prolang => '14', provolatile => 's', + proname => 'textanycat', prolang => 'sql', provolatile => 's', prorettype => 'text', proargtypes => 'text anynonarray', prosrc => 'select $1 || $2::pg_catalog.text' }, { oid => '2004', - proname => 'anytextcat', prolang => '14', provolatile => 's', + proname => 'anytextcat', prolang => 'sql', provolatile => 's', prorettype => 'text', proargtypes => 'anynonarray text', prosrc => 'select $1::pg_catalog.text || $2' }, @@ -5583,15 +5583,15 @@ proargtypes => 'timestamp timestamp timestamp timestamp', prosrc => 'overlaps_timestamp' }, { oid => '2042', descr => 'intervals overlap?', - proname => 'overlaps', prolang => '14', proisstrict => 'f', + proname => 'overlaps', prolang => 'sql', proisstrict => 'f', prorettype => 'bool', proargtypes => 'timestamp interval timestamp interval', prosrc => 'select ($1, ($1 + $2)) overlaps ($3, ($3 + $4))' }, { oid => '2043', descr => 'intervals overlap?', - proname => 'overlaps', prolang => '14', proisstrict => 'f', + proname => 'overlaps', prolang => 'sql', proisstrict => 'f', prorettype => 'bool', proargtypes => 'timestamp timestamp timestamp interval', prosrc => 'select ($1, $2) overlaps ($3, ($3 + $4))' }, { oid => '2044', descr => 'intervals overlap?', - proname => 'overlaps', prolang => '14', proisstrict => 'f', + proname => 'overlaps', prolang => 'sql', proisstrict => 'f', prorettype => 'bool', proargtypes => 'timestamp interval timestamp timestamp', prosrc => 'select ($1, ($1 + $2)) overlaps ($3, $4)' }, { oid => '2045', descr => 'less-equal-greater', @@ -5657,7 +5657,7 @@ proargtypes => 'timestamp timestamp', prosrc => 'timestamp_age' }, { oid => '2059', descr => 'date difference from today preserving months and years', - proname => 'age', prolang => '14', provolatile => 's', + proname => 'age', prolang => 'sql', provolatile => 's', prorettype => 'interval', proargtypes => 'timestamp', prosrc => 'select pg_catalog.age(cast(current_date as timestamp without time zone), $1)' }, @@ -5680,7 +5680,7 @@ proname => 'substring', prorettype => 'text', proargtypes => 'text text', prosrc => 'textregexsubstr' }, { oid => '2074', descr => 'extract text matching SQL99 regular expression', - proname => 'substring', prolang => '14', prorettype => 'text', + proname => 'substring', prolang => 'sql', prorettype => 'text', proargtypes => 'text text text', prosrc => 'select pg_catalog.substring($1, pg_catalog.similar_escape($2, $3))' }, @@ -6019,11 +6019,11 @@ proname => 'pg_sleep', provolatile => 'v', prorettype => 'void', proargtypes => 'float8', prosrc => 'pg_sleep' }, { oid => '3935', descr => 'sleep for the specified interval', - proname => 'pg_sleep_for', prolang => '14', provolatile => 'v', + proname => 'pg_sleep_for', prolang => 'sql', provolatile => 'v', prorettype => 'void', proargtypes => 'interval', prosrc => 'select pg_catalog.pg_sleep(extract(epoch from pg_catalog.clock_timestamp() operator(pg_catalog.+) $1) operator(pg_catalog.-) extract(epoch from pg_catalog.clock_timestamp()))' }, { oid => '3936', descr => 'sleep until the specified time', - proname => 'pg_sleep_until', prolang => '14', provolatile => 'v', + proname => 'pg_sleep_until', prolang => 'sql', provolatile => 'v', prorettype => 'void', proargtypes => 'timestamptz', prosrc => 'select pg_catalog.pg_sleep(extract(epoch from $1) operator(pg_catalog.-) extract(epoch from pg_catalog.clock_timestamp()))' }, { oid => '315', descr => 'Is JIT compilation available in this session?', @@ -6818,7 +6818,7 @@ proargtypes => 'name', prosrc => 'pg_database_size_name' }, { oid => '2325', descr => 'disk space usage for the main fork of the specified table or index', - proname => 'pg_relation_size', prolang => '14', provolatile => 'v', + proname => 'pg_relation_size', prolang => 'sql', provolatile => 'v', prorettype => 'int8', proargtypes => 'regclass', prosrc => 'select pg_catalog.pg_relation_size($1, \'main\')' }, { oid => '2332', @@ -7639,21 +7639,21 @@ # formerly-missing interval + datetime operators { oid => '2546', - proname => 'interval_pl_date', prolang => '14', prorettype => 'timestamp', + proname => 'interval_pl_date', prolang => 'sql', prorettype => 'timestamp', proargtypes => 'interval date', prosrc => 'select $2 + $1' }, { oid => '2547', - proname => 'interval_pl_timetz', prolang => '14', prorettype => 'timetz', + proname => 'interval_pl_timetz', prolang => 'sql', prorettype => 'timetz', proargtypes => 'interval timetz', prosrc => 'select $2 + $1' }, { oid => '2548', - proname => 'interval_pl_timestamp', prolang => '14', + proname => 'interval_pl_timestamp', prolang => 'sql', prorettype => 'timestamp', proargtypes => 'interval timestamp', prosrc => 'select $2 + $1' }, { oid => '2549', - proname => 'interval_pl_timestamptz', prolang => '14', provolatile => 's', + proname => 'interval_pl_timestamptz', prolang => 'sql', provolatile => 's', prorettype => 'timestamptz', proargtypes => 'interval timestamptz', prosrc => 'select $2 + $1' }, { oid => '2550', - proname => 'integer_pl_date', prolang => '14', prorettype => 'date', + proname => 'integer_pl_date', prolang => 'sql', prorettype => 'date', proargtypes => 'int4 date', prosrc => 'select $2 + $1' }, { oid => '2556', descr => 'get OIDs of databases in a tablespace', @@ -8038,7 +8038,7 @@ proname => 'xpath', prorettype => '_xml', proargtypes => 'text xml _text', prosrc => 'xpath' }, { oid => '2932', descr => 'evaluate XPath expression', - proname => 'xpath', prolang => '14', prorettype => '_xml', + proname => 'xpath', prolang => 'sql', prorettype => '_xml', proargtypes => 'text xml', prosrc => 'select pg_catalog.xpath($1, $2, \'{}\'::pg_catalog.text[])' }, @@ -8051,7 +8051,7 @@ proname => 'xpath_exists', prorettype => 'bool', proargtypes => 'text xml _text', prosrc => 'xpath_exists' }, { oid => '3050', descr => 'test XML value against XPath expression', - proname => 'xpath_exists', prolang => '14', prorettype => 'bool', + proname => 'xpath_exists', prolang => 'sql', prorettype => 'bool', proargtypes => 'text xml', prosrc => 'select pg_catalog.xpath_exists($1, $2, \'{}\'::pg_catalog.text[])' }, { oid => '3051', descr => 'determine if a string is well formed XML', diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index 19d090a475..c2bb9516dc 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -42,7 +42,7 @@ CATALOG(pg_proc,1255,ProcedureRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(81,Proce Oid proowner BKI_DEFAULT(PGUID); /* OID of pg_language entry */ - Oid prolang BKI_DEFAULT(12); + Oid prolang BKI_DEFAULT(internal) BKI_LOOKUP(pg_language); /* estimated execution cost */ float4 procost BKI_DEFAULT(1); diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index 0b7cdf8dd5..eb2346b8d3 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -269,16 +269,14 @@ sub GenerateFiles "LIBPGTYPES"); chdir('src/backend/utils'); - my $pg_language_dat = '../../../src/include/catalog/pg_language.dat'; my $pg_proc_dat = '../../../src/include/catalog/pg_proc.dat'; if ( IsNewer('fmgr-stamp', 'Gen_fmgrtab.pl') || IsNewer('fmgr-stamp', '../catalog/Catalog.pm') - || IsNewer('fmgr-stamp', $pg_language_dat) || IsNewer('fmgr-stamp', $pg_proc_dat) || IsNewer('fmgr-stamp', '../../../src/include/access/transam.h')) { system( - "perl -I ../catalog Gen_fmgrtab.pl -I../../../src/include/ $pg_language_dat $pg_proc_dat" + "perl -I ../catalog Gen_fmgrtab.pl -I../../../src/include/ $pg_proc_dat" ); open(my $f, '>', 'fmgr-stamp') || confess "Could not touch fmgr-stamp";