]> granicus.if.org Git - postgresql/commitdiff
Use symbolic references for pg_language OIDs in the bootstrap data.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 3 Jan 2019 23:38:49 +0000 (18:38 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 3 Jan 2019 23:38:49 +0000 (18:38 -0500)
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

doc/src/sgml/bki.sgml
src/backend/catalog/genbki.pl
src/backend/utils/Gen_fmgrtab.pl
src/backend/utils/Makefile
src/include/catalog/pg_proc.dat
src/include/catalog/pg_proc.h
src/tools/msvc/Solution.pm

index 786abb95d4d99e1be0c99bbe4afa72857c6dea21..def63eb615d4f6265df7ddd36957090a4119cf9f 100644 (file)
     that's error-prone and hard to understand, so for frequently-referenced
     catalogs, <filename>genbki.pl</filename> 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:
    </para>
 
    <itemizedlist>
       by attaching <literal>BKI_LOOKUP(<replaceable>lookuprule</replaceable>)</literal>
       to the column's definition, where <replaceable>lookuprule</replaceable>
       is <literal>pg_am</literal>, <literal>pg_proc</literal>,
+      <literal>pg_language</literal>,
       <literal>pg_operator</literal>, <literal>pg_opclass</literal>,
       <literal>pg_opfamily</literal>, or <literal>pg_type</literal>.
       <literal>BKI_LOOKUP</literal> can be attached to columns of
index 9be683e287318043cb224bccfdf445ff452b68ed..f45971f35862efebd513e2efd6472dc7288fb968 100644 (file)
@@ -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,
index 26b0b079730115396c37b1a36fc7c33fec818735..cafe40806fd3f30a7a7c8a27a381dce1271593db 100644 (file)
@@ -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,
          {
index 8f3e293b0d880b6e60f20842dc6ee3da78baff2e..a5251327e275443f2c5ff476121b3c23eb8b7491 100644 (file)
@@ -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
index 3233888e357836c1e96798f3b42e7c75e8f93a4d..dc48bf822b24fcc538f0f29cf54afc6b7e3b548a 100644 (file)
   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',
   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)' },
 
   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',
   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)' },
   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)' },
 
 # 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' },
 
   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',
   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)' },
 
   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',
   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',
   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',
   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',
   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',
   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',
   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',
   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)' },
 
   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
   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',
   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' },
 
   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',
   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)' },
 
   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))' },
 
   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?',
   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',
 
 # 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',
   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[])' },
 
   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',
index 19d090a4755c9a4d60034ed648c7ae5c4284262b..c2bb9516dc3fe6c43cdbd122f7c02f13ac11eefe 100644 (file)
@@ -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);
index 0b7cdf8dd58bf47703a833d25640a801d173455c..eb2346b8d3e9c71b606a23c2980f6ef5f58b589c 100644 (file)
@@ -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";