diff options
author | Tom Lane | 2019-01-03 23:38:49 +0000 |
---|---|---|
committer | Tom Lane | 2019-01-03 23:38:49 +0000 |
commit | 814c9019aa7b0ce3a4f19415023a256fdd717b20 (patch) | |
tree | 942471ebbf79617de32fdbd35d8ecb4f2b2e8dc9 /src/backend/utils/Gen_fmgrtab.pl | |
parent | 7170268efd511cb43bee49cd7963216a3f228648 (diff) |
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
Diffstat (limited to 'src/backend/utils/Gen_fmgrtab.pl')
-rw-r--r-- | src/backend/utils/Gen_fmgrtab.pl | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/backend/utils/Gen_fmgrtab.pl b/src/backend/utils/Gen_fmgrtab.pl index 26b0b079730..cafe40806fd 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, { |