Patch: Remove all declarations from pg_attribute.h, consolidate BKI scripts
Greetings,
Following up on my experimental patch last month to revamp the BKI
infrastructure, I am proposing a less invasive set of changes with the
hope of offering something committable. Some of these were discussed
by Robert Haas and others last summer.
1. Remove all DATA() declarations from pg_attribute.h, since they are
easily generated. Introduce a new BKI pseudo-command
BKI_NAILED_IN_CACHE, which indicates that relcache.c needs a
Schema_pg_foo declaration for that catalog. Place these declarations
in a new header schemapg.h. This will reduce the effort to add or
change critical tables.
2. Use identical scripts on Posix and Windows systems, using Perl 5.6
(no CPAN modules needed). The grepping of the catalog headers is done
by Catalog.pm, which gives the scripts gen_bki.pl and gen_fmgr.pl a
structured interface to the data. The pg_type info is saved so that
the relevant fields can be copied into those of pg_attribute.
3. Make the BKI files, fmgrtab.c, fmgroids.h, and schemapg.h distprep
targets, so distribution tarballs can still be built without Perl on
Posix systems.
Feedback on the Makefile changes would be appreciated, since that was
the hardest part for me. The MSVC changes are untested.
John Naylor
Attachments:
bki_revamp_v1.patchtext/x-patch; charset=US-ASCII; name=bki_revamp_v1.patchDownload
diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml
index 0e4f829..0aedf8e 100644
*** a/doc/src/sgml/installation.sgml
--- b/doc/src/sgml/installation.sgml
*************** su - postgres
*** 310,316 ****
<primary>perl</primary>
</indexterm>
! <application>Perl</> is also needed to build from a CVS checkout,
or if you changed the input files for any of the build steps that
use Perl scripts. If building on Windows you will need
<application>Perl</> in any case.
--- 310,316 ----
<primary>perl</primary>
</indexterm>
! <application>Perl</> 5.6 or later is needed to build from a CVS checkout,
or if you changed the input files for any of the build steps that
use Perl scripts. If building on Windows you will need
<application>Perl</> in any case.
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index 7a6e3a9..9dfd396 100644
*** a/src/Makefile.global.in
--- b/src/Makefile.global.in
*************** $(top_builddir)/src/interfaces/ecpg/incl
*** 517,522 ****
--- 517,545 ----
$(top_builddir)/config.status: $(top_srcdir)/configure
cd $(top_builddir) && ./config.status --recheck
+ # This variable is placed here so that dependencies in src/backend/catalog/Makefile
+ # can be referred to in src/backend/Makefile.
+ #
+ # Note: there are some dependencies on the ordering in which
+ # the catalog header files are assembled into postgres.bki.
+ # See src/backend/catalog/README
+
+ POSTGRES_BKI_SRCS = $(addprefix $(top_srcdir)/src/include/catalog/,\
+ pg_proc.h pg_type.h pg_attribute.h pg_class.h \
+ pg_attrdef.h pg_constraint.h pg_inherits.h pg_index.h pg_operator.h \
+ pg_opfamily.h pg_opclass.h pg_am.h pg_amop.h pg_amproc.h \
+ pg_language.h pg_largeobject_metadata.h pg_largeobject.h pg_aggregate.h \
+ pg_statistic.h pg_rewrite.h pg_trigger.h pg_listener.h pg_description.h \
+ pg_cast.h pg_enum.h pg_namespace.h pg_conversion.h pg_depend.h \
+ pg_database.h pg_db_role_setting.h pg_tablespace.h pg_pltemplate.h \
+ pg_authid.h pg_auth_members.h pg_shdepend.h pg_shdescription.h \
+ pg_ts_config.h pg_ts_config_map.h pg_ts_dict.h \
+ pg_ts_parser.h pg_ts_template.h \
+ pg_foreign_data_wrapper.h pg_foreign_server.h pg_user_mapping.h \
+ pg_default_acl.h \
+ toasting.h indexing.h \
+ )
+
endif # not PGXS
diff --git a/src/backend/Makefile b/src/backend/Makefile
index 34b4a8b..59d4975 100644
*** a/src/backend/Makefile
--- b/src/backend/Makefile
*************** endif
*** 111,117 ****
endif # aix
# Update the commonly used headers before building the subdirectories
! $(SUBDIRS:%=%-recursive): $(top_builddir)/src/include/parser/gram.h $(top_builddir)/src/include/utils/fmgroids.h $(top_builddir)/src/include/utils/probes.h
# The postgres.o target is needed by the rule in Makefile.global that
--- 111,120 ----
endif # aix
# Update the commonly used headers before building the subdirectories
! $(SUBDIRS:%=%-recursive): $(top_builddir)/src/include/parser/gram.h \
! $(top_builddir)/src/include/catalog/schemapg.h \
! $(top_builddir)/src/include/utils/fmgroids.h \
! $(top_builddir)/src/include/utils/probes.h
# The postgres.o target is needed by the rule in Makefile.global that
*************** postgres.o: $(OBJS)
*** 127,133 ****
parser/gram.h: parser/gram.y
$(MAKE) -C parser gram.h
! utils/fmgroids.h: utils/Gen_fmgrtab.sh $(top_srcdir)/src/include/catalog/pg_proc.h
$(MAKE) -C utils fmgroids.h
utils/probes.h: utils/probes.d
--- 130,139 ----
parser/gram.h: parser/gram.y
$(MAKE) -C parser gram.h
! catalog/schemapg.h: catalog/gen_bki.pl catalog/Catalog.pm $(POSTGRES_BKI_SRCS) $(top_builddir)/src/include/pg_config_manual.h
! $(MAKE) -C catalog schemapg.h
!
! utils/fmgroids.h: utils/gen_fmgr.pl catalog/Catalog.pm $(top_srcdir)/src/include/catalog/pg_proc.h
$(MAKE) -C utils fmgroids.h
utils/probes.h: utils/probes.d
*************** utils/probes.h: utils/probes.d
*** 136,150 ****
# Make symlinks for these headers in the include directory. That way
# we can cut down on the -I options. Also, a symlink is automatically
# up to date when we update the base file.
$(top_builddir)/src/include/parser/gram.h: parser/gram.h
prereqdir=`cd $(dir $<) >/dev/null && pwd` && \
cd $(dir $@) && rm -f $(notdir $@) && \
$(LN_S) "$$prereqdir/$(notdir $<)" .
$(top_builddir)/src/include/utils/fmgroids.h: utils/fmgroids.h
! cd $(dir $@) && rm -f $(notdir $@) && \
! $(LN_S) ../../../$(subdir)/utils/fmgroids.h .
$(top_builddir)/src/include/utils/probes.h: utils/probes.h
cd $(dir $@) && rm -f $(notdir $@) && \
--- 142,167 ----
# Make symlinks for these headers in the include directory. That way
# we can cut down on the -I options. Also, a symlink is automatically
# up to date when we update the base file.
+ #
+ # The point of the prereqdir incantation in some of the rules below is to force
+ # the symlink to use an absolute path rather than a relative path. For headers
+ # which are generated by make distprep, the copy within src/backend will be in
+ # the source tree, and the copy in src/include will be in the build tree.
$(top_builddir)/src/include/parser/gram.h: parser/gram.h
prereqdir=`cd $(dir $<) >/dev/null && pwd` && \
cd $(dir $@) && rm -f $(notdir $@) && \
$(LN_S) "$$prereqdir/$(notdir $<)" .
+ $(top_builddir)/src/include/catalog/schemapg.h: catalog/schemapg.h
+ prereqdir=`cd $(dir $<) >/dev/null && pwd` && \
+ cd $(dir $@) && rm -f $(notdir $@) && \
+ $(LN_S) "$$prereqdir/$(notdir $<)" .
+
$(top_builddir)/src/include/utils/fmgroids.h: utils/fmgroids.h
! prereqdir=`cd $(dir $<) >/dev/null && pwd` && \
! cd $(dir $@) && rm -f $(notdir $@) && \
! $(LN_S) "$$prereqdir/$(notdir $<)" .
$(top_builddir)/src/include/utils/probes.h: utils/probes.h
cd $(dir $@) && rm -f $(notdir $@) && \
*************** utils/probes.o: utils/probes.d $(SUBDIRO
*** 160,165 ****
--- 177,184 ----
distprep:
$(MAKE) -C parser gram.c gram.h scan.c
$(MAKE) -C bootstrap bootparse.c bootscanner.c
+ $(MAKE) -C catalog postgres.bki postgres.description postgres.shdescription schemapg.h
+ $(MAKE) -C utils fmgrtab.c fmgroids.h
$(MAKE) -C utils/misc guc-file.c
*************** endif
*** 244,250 ****
clean:
rm -f $(LOCALOBJS) postgres$(X) $(POSTGRES_IMP) \
$(top_srcdir)/src/include/parser/gram.h \
! $(top_builddir)/src/include/utils/fmgroids.h
ifeq ($(PORTNAME), cygwin)
rm -f postgres.dll postgres.def libpostgres.a
endif
--- 263,270 ----
clean:
rm -f $(LOCALOBJS) postgres$(X) $(POSTGRES_IMP) \
$(top_srcdir)/src/include/parser/gram.h \
! $(top_srcdir)/src/include/catalog/schemapg.h \
! $(top_srcdir)/src/include/utils/fmgroids.h
ifeq ($(PORTNAME), cygwin)
rm -f postgres.dll postgres.def libpostgres.a
endif
*************** maintainer-clean: distclean
*** 261,266 ****
--- 281,292 ----
parser/gram.c \
parser/scan.c \
parser/gram.h \
+ catalog/postgres.bki \
+ catalog/postgres.description \
+ catalog/postgres.shdescription \
+ catalog/schemapg.h \
+ utils/fmgroids.h \
+ utils/fmgrtab.c \
utils/misc/guc-file.c
diff --git a/src/backend/catalog/Catalog.pm b/src/backend/catalog/Catalog.pm
index ...567cb9c .
*** a/src/backend/catalog/Catalog.pm
--- b/src/backend/catalog/Catalog.pm
***************
*** 0 ****
--- 1,194 ----
+ #----------------------------------------------------------------------
+ #
+ # Catalog.pm
+ # perl module which extracts info from catalog headers into Perl
+ # data structures
+ #
+ # Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
+ # Portions Copyright (c) 1994, Regents of the University of California
+ #
+ # $PostgreSQL$
+ #
+ #----------------------------------------------------------------------
+
+ package Catalog;
+
+ use strict;
+ use warnings;
+
+ require Exporter;
+ our @ISA = qw(Exporter);
+ our @EXPORT = ();
+ our @EXPORT_OK = qw(Catalogs RenameTempFile);
+
+ # Call this function with an array of the headers to parse. Returns a reference
+ # to a hash of hashes of lists.
+ sub Catalogs
+ {
+ my (%catalogs, $catname, $declaring_attributes, $most_recent);
+ $catalogs{names} = [];
+
+ # There are a few types which are given one name in the C source, but a
+ # different name at the SQL level. These are enumerated here.
+ my %RENAME_ATTTYPE = (
+ 'Oid' => 'oid',
+ 'NameData' => 'name',
+ 'TransactionId' => 'xid'
+ );
+
+ foreach my $input_file (@_)
+ {
+ my %catalog;
+ $catalog{columns} = [];
+ $catalog{data} = [];
+
+ open(INPUT_FILE, '<', $input_file) || die "$input_file: $!";
+
+ # Scan the input file.
+ while (<INPUT_FILE>)
+ {
+
+ # Strip C-style comments.
+ s;/\*(.|\n)*\*/;;g;
+ if (m;/\*;)
+ {
+ my $next_line = <INPUT_FILE>;
+ die "$input_file: ends within C-style comment\n"
+ if !defined $next_line;
+ $_ .= $next_line;
+ redo;
+ }
+
+ # Strip useless whitespace and trailing semicolons.
+ chomp;
+ s/^\s+//;
+ s/;\s*$//;
+ s/\s+/ /g;
+
+ if (/^DATA\(insert(\s+OID\s+=\s+(\d+))?\s+\(\s*(.*)\s*\)\s*\)$/)
+ {
+ push @{ $catalog{data} }, {oid => $2, bki_values => $3};
+ }
+ elsif (/^DESCR\(\"(.*)\"\)$/)
+ {
+ $most_recent = $catalog{data}->[-1];
+ if (ref $most_recent ne 'HASH')
+ {
+ die "DESCR() does not apply to any catalog ($input_file)";
+ }
+ if (!defined $most_recent->{oid})
+ {
+ die "DESCR() does not apply to any oid ($input_file)";
+ }
+ elsif ($1 ne '')
+ {
+ $most_recent->{descr} = $1;
+ }
+ }
+ elsif (/^SHDESCR\(\"(.*)\"\)$/)
+ {
+ $most_recent = $catalog{data}->[-1];
+ if (ref $most_recent ne 'HASH')
+ {
+ die "SHDESCR() does not apply to any catalog ($input_file)";
+ }
+ if (!defined $most_recent->{oid})
+ {
+ die "SHDESCR() does not apply to any oid ($input_file)";
+ }
+ elsif ($1 ne '')
+ {
+ $most_recent->{shdescr} = $1;
+ }
+ }
+ elsif (/^DECLARE_TOAST\(\s*(\w+),\s*(\d+),\s*(\d+)\)/)
+ {
+ $catname = 'toasting';
+ my ($toast_name, $toast_oid, $index_oid) = ($1, $2, $3);
+ push @{ $catalog{data} }, "declare toast $toast_oid $index_oid on $toast_name\n";
+ }
+ elsif (/^DECLARE_(UNIQUE_)?INDEX\(\s*(\w+),\s*(\d+),\s*(.+)\)/)
+ {
+ $catname = 'indexing';
+ my ($is_unique, $index_name, $index_oid, $using) = ($1, $2, $3, $4);
+ push @{ $catalog{data} },
+ sprintf(
+ "declare %sindex %s %s %s\n",
+ $is_unique ? 'unique ' : '',
+ $index_name, $index_oid, $using
+ );
+ }
+ elsif (/^CATALOG\(([^,]*),(\d+)\)/)
+ {
+ $catname = $1;
+ $catalog{relation_oid} = $2;
+
+ # Store pg_* catalog names in the same order we receive them
+ push @{ $catalogs{names} }, $catname;
+
+ $catalog{bootstrap} = /BKI_BOOTSTRAP/ ? ' bootstrap' : '';
+ $catalog{shared_relation} = /BKI_SHARED_RELATION/ ? ' shared_relation' : '';
+ $catalog{without_oids} = /BKI_WITHOUT_OIDS/ ? ' without_oids' : '';
+ $catalog{rowtype_oid} = /BKI_ROWTYPE_OID\((\d+)\)/ ? " rowtype_oid $1" : '';
+ $catalog{nailed_in_cache} = /BKI_NAILED_IN_CACHE/ ? 'True' : '';
+ $declaring_attributes = 1;
+ }
+ elsif ($declaring_attributes)
+ {
+ next if (/^{|^$/);
+ if (/^}/)
+ {
+ undef $declaring_attributes;
+ }
+ else
+ {
+ my ($atttype, $attname) = split /\s+/, $_;
+ if (exists $RENAME_ATTTYPE{$atttype})
+ {
+ $atttype = $RENAME_ATTTYPE{$atttype};
+ }
+ if ($attname =~ /(.*)\[.*\]/) # array attribute
+ {
+ $attname = $1;
+ $atttype .= '[]'; # variable-length only
+ }
+ push @{ $catalog{columns} }, {$attname => $atttype};
+ }
+ }
+ }
+ $catalogs{$catname} = \%catalog;
+ close INPUT_FILE;
+ }
+ return \%catalogs;
+ }
+
+ # Rename temporary files to final names, if anything has changed.
+ # Call this function with the final name.
+ sub RenameTempFile
+ {
+ my $final_name = shift;
+ my $temp_name = $final_name . '.tmp';
+ if (-e $final_name && -s $temp_name == -s $final_name)
+ {
+ open TN, '<', "$temp_name" || die "$temp_name: $!";
+ if (open FN, '<', $final_name)
+ {
+ local $/ = undef;
+ my $tn = <TN>;
+ my $fn = <FN>;
+ close FN;
+ if ($tn eq $fn)
+ {
+ print "$final_name unchanged, not replacing\n";
+ close TN;
+ unlink($temp_name) || die "unlink: $temp_name: $!";
+ return;
+ }
+ }
+ close TN;
+ }
+ print "Writing $final_name\n";
+ rename($temp_name, $final_name) || die "rename: $temp_name: $!";
+ }
+
+ 1;
diff --git a/src/backend/catalog/Makefile b/src/backend/catalog/Makefile
index 6f7e4d7..228f420 100644
*** a/src/backend/catalog/Makefile
--- b/src/backend/catalog/Makefile
*************** BKIFILES = postgres.bki postgres.descrip
*** 19,45 ****
include $(top_srcdir)/src/backend/common.mk
! all: $(BKIFILES)
!
! # Note: there are some undocumented dependencies on the ordering in which
! # the catalog header files are assembled into postgres.bki. In particular,
! # indexing.h had better be last, and toasting.h just before it.
!
! POSTGRES_BKI_SRCS = $(addprefix $(top_srcdir)/src/include/catalog/,\
! pg_proc.h pg_type.h pg_attribute.h pg_class.h \
! pg_attrdef.h pg_constraint.h pg_inherits.h pg_index.h pg_operator.h \
! pg_opfamily.h pg_opclass.h pg_am.h pg_amop.h pg_amproc.h \
! pg_language.h pg_largeobject_metadata.h pg_largeobject.h pg_aggregate.h \
! pg_statistic.h pg_rewrite.h pg_trigger.h pg_listener.h pg_description.h \
! pg_cast.h pg_enum.h pg_namespace.h pg_conversion.h pg_depend.h \
! pg_database.h pg_db_role_setting.h pg_tablespace.h pg_pltemplate.h \
! pg_authid.h pg_auth_members.h pg_shdepend.h pg_shdescription.h \
! pg_ts_config.h pg_ts_config_map.h pg_ts_dict.h \
! pg_ts_parser.h pg_ts_template.h \
! pg_foreign_data_wrapper.h pg_foreign_server.h pg_user_mapping.h \
! pg_default_acl.h \
! toasting.h indexing.h \
! )
pg_includes = $(sort -I$(top_srcdir)/src/include -I$(top_builddir)/src/include)
--- 19,25 ----
include $(top_srcdir)/src/backend/common.mk
! all: $(BKIFILES) schemapg.h
pg_includes = $(sort -I$(top_srcdir)/src/include -I$(top_builddir)/src/include)
*************** postgres.description: postgres.bki ;
*** 48,55 ****
postgres.shdescription: postgres.bki ;
! postgres.bki: genbki.sh $(POSTGRES_BKI_SRCS) $(top_builddir)/src/include/pg_config_manual.h
! AWK='$(AWK)' $(SHELL) $< $(pg_includes) --set-version=$(VERSION) -o postgres $(POSTGRES_BKI_SRCS)
.PHONY: install-data
install-data: $(BKIFILES) installdirs
--- 28,37 ----
postgres.shdescription: postgres.bki ;
! schemapg.h: postgres.bki ;
!
! postgres.bki: gen_bki.pl Catalog.pm $(POSTGRES_BKI_SRCS) $(top_builddir)/src/include/pg_config_manual.h
! $(PERL) $< $(pg_includes) --set-version=$(VERSION) -o $(srcdir) $(POSTGRES_BKI_SRCS)
.PHONY: install-data
install-data: $(BKIFILES) installdirs
*************** uninstall-data:
*** 68,71 ****
rm -f $(addprefix '$(DESTDIR)$(datadir)'/, $(BKIFILES) system_views.sql information_schema.sql sql_features.txt)
clean:
! rm -f $(BKIFILES)
--- 50,54 ----
rm -f $(addprefix '$(DESTDIR)$(datadir)'/, $(BKIFILES) system_views.sql information_schema.sql sql_features.txt)
clean:
! # postgres.bki, postgres.description, postgres.shdescription, and schemapg.h
! # are in the distribution tarball, so they are not cleaned here.
diff --git a/src/backend/catalog/README b/src/backend/catalog/README
index 9609641..c8f4377 100644
*** a/src/backend/catalog/README
--- b/src/backend/catalog/README
*************** This directory contains .c files that ma
*** 7,13 ****
src/include/catalog contains the .h files that define the structure
of the system catalogs.
! When the compile-time scripts (such as Gen_fmgrtab.sh and genbki.sh)
execute, they grep the DATA statements out of the .h files and munge
these in order to generate the postgres.bki file. The .bki file is then
used as input to initdb (which is just a wrapper around postgres
--- 7,13 ----
src/include/catalog contains the .h files that define the structure
of the system catalogs.
! When the compile-time scripts (gen_fmgr.pl and gen_bki.pl)
execute, they grep the DATA statements out of the .h files and munge
these in order to generate the postgres.bki file. The .bki file is then
used as input to initdb (which is just a wrapper around postgres
*************** catalog's .h file, and use the #define s
*** 44,50 ****
the actual numeric value of any OID in C code is considered very bad form.
Direct references to pg_proc OIDs are common enough that there's a special
mechanism to create the necessary #define's automatically: see
! backend/utils/Gen_fmgrtab.sh. We also have standard conventions for setting
up #define's for the pg_class OIDs of system catalogs and indexes. For all
the other system catalogs, you have to manually create any #define's you
need.
--- 44,50 ----
the actual numeric value of any OID in C code is considered very bad form.
Direct references to pg_proc OIDs are common enough that there's a special
mechanism to create the necessary #define's automatically: see
! backend/utils/gen_fmgr.pl. We also have standard conventions for setting
up #define's for the pg_class OIDs of system catalogs and indexes. For all
the other system catalogs, you have to manually create any #define's you
need.
*************** pg_class, pg_attribute, and pg_type. Av
*** 70,80 ****
catalogs if at all possible; generally, only tables that must be written to
in order to create a table should be bootstrapped.
! - Certain BOOTSTRAP tables must be at the start of the Makefile
POSTGRES_BKI_SRCS variable, as these cannot be created through the standard
heap_create_with_catalog process, because it needs these tables to exist
already. The list of files this currently includes is:
pg_proc.h pg_type.h pg_attribute.h pg_class.h
Also, indexing.h must be last, since the indexes can't be created until all
the tables are in place, and toasting.h should probably be next-to-last
(or at least after all the tables that need toast tables). There are
--- 70,81 ----
catalogs if at all possible; generally, only tables that must be written to
in order to create a table should be bootstrapped.
! - Certain BOOTSTRAP tables must be at the start of the src/Makefile.global
POSTGRES_BKI_SRCS variable, as these cannot be created through the standard
heap_create_with_catalog process, because it needs these tables to exist
already. The list of files this currently includes is:
pg_proc.h pg_type.h pg_attribute.h pg_class.h
+ Of these, pg_type.h must come before pg_attribute.
Also, indexing.h must be last, since the indexes can't be created until all
the tables are in place, and toasting.h should probably be next-to-last
(or at least after all the tables that need toast tables). There are
diff --git a/src/backend/catalog/gen_bki.pl b/src/backend/catalog/gen_bki.pl
index ...3fb61b6 .
*** a/src/backend/catalog/gen_bki.pl
--- b/src/backend/catalog/gen_bki.pl
***************
*** 0 ****
--- 1,408 ----
+ #!/usr/bin/perl
+ #----------------------------------------------------------------------
+ #
+ # gen_bki.pl
+ # Perl script which generates postgres.bki, postgres.description,
+ # postgres.shdescription, and schemapg.h from specially formatted
+ # header files. The .bki files are used to initialize the postgres
+ # template database.
+ #
+ # Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
+ # Portions Copyright (c) 1994, Regents of the University of California
+ #
+ # $PostgreSQL$
+ #
+ #----------------------------------------------------------------------
+
+ use Catalog;
+
+ use strict;
+ use warnings;
+
+ my @input_files;
+ my @include_path;
+ my $output_path = '';
+ my $major_version;
+ while (@ARGV)
+ {
+ my $arg = shift @ARGV;
+ if ($arg !~ /^-/)
+ {
+ push @input_files, $arg;
+ }
+ elsif ($arg =~ /^-o/)
+ {
+ $output_path = length($arg) > 2 ? substr($arg, 2) : shift @ARGV;
+ }
+ elsif ($arg =~ /^-I/)
+ {
+ push @include_path, length($arg) > 2 ? substr($arg, 2) : shift @ARGV;
+ }
+ elsif ($arg =~ /^--set-version=(\d+\.\d+).*$/)
+ {
+ $major_version = $1;
+ }
+ else
+ {
+ usage();
+ }
+ }
+
+ # Sanity check arguments.
+ die "No input files.\n" if !@input_files;
+ die "No include path; you must specify -I at least once.\n" if !@include_path;
+ die "Version not specified or wrong format.\n" if !defined $major_version;
+
+ # CAUTION: be wary about what symbols you substitute into the .bki file here!
+ # It's okay to substitute things that are expected to be really constant
+ # within a given Postgres release, such as fixed OIDs. Do not substitute
+ # anything that could depend on platform or configuration. (The right place
+ # to handle those sorts of things is in initdb.c's bootstrap_template1().)
+ my $BOOTSTRAP_SUPERUSERID = find_defined_symbol('pg_authid.h', 'BOOTSTRAP_SUPERUSERID');
+ my $PG_CATALOG_NAMESPACE = find_defined_symbol('pg_namespace.h', 'PG_CATALOG_NAMESPACE');
+
+ # Make sure output_path ends in a slash.
+ if ($output_path ne '' && substr($output_path, -1) ne '/')
+ {
+ $output_path .= '/';
+ }
+
+ # Open temp files
+ open BKI, '>', $output_path . 'postgres.bki.tmp'
+ || die "can't open postgres.bki.tmp: $!";
+ open SCHEMAPG, '>', $output_path . 'schemapg.h.tmp'
+ || die "can't open 'schemapg.h.tmp: $!";
+ open DESCR, '>', $output_path . 'postgres.description.tmp'
+ || die "can't open postgres.description.tmp: $!";
+ open SHDESCR, '>', $output_path . 'postgres.shdescription.tmp'
+ || die "can't open postgres.shdescription.tmp: $!";
+
+ # version
+ print BKI "# PostgreSQL $major_version\n";
+
+ my %schemapg_entries;
+ my @cached_tables;
+ our @types;
+ my $catalogs = Catalog::Catalogs(@input_files);
+
+ foreach my $catname ( @{ $catalogs->{names} } )
+ {
+ my $catalog = $catalogs->{$catname};
+ print BKI "create $catname $catalog->{relation_oid}"
+ . $catalog->{shared_relation}
+ . $catalog->{bootstrap}
+ . $catalog->{without_oids}
+ . $catalog->{rowtype_oid}. "\n";
+
+ my %bki_attr;
+ my @attnames;
+ foreach my $column ( @{ $catalog->{columns} } )
+ {
+ my ($attname, $atttype) = %$column;
+ $bki_attr{$attname} = $atttype;
+ push @attnames, $attname;
+ }
+ print BKI " (\n";
+ print BKI join " ,\n", map(" $_ = $bki_attr{$_}", @attnames);
+ print BKI "\n )\n";
+
+ if ($catalog->{bootstrap} eq '')
+ {
+ print BKI "open $catname\n";
+ }
+
+ # pg_attribute.h, not having any DATA() entries, requires its own logic.
+ # We need to have already processed pg_type.h, since we use info from it.
+ if ($catname eq 'pg_attribute')
+ {
+ foreach my $table_name ( @{ $catalogs->{names} } )
+ {
+ my $table = $catalogs->{$table_name};
+
+ # relcache.c needs to have pg_attribute entries for the relations
+ # that are nailed in cache. These include the 4 bootstrapped tables
+ # (pg_proc, pg_type, pg_attribute, pg_class), and some others
+ next if $table->{nailed_in_cache} ne 'True';
+
+ $schemapg_entries{$table_name} = [];
+ push @cached_tables, $table_name;
+ my $is_bootstrap = $table->{bootstrap};
+
+ # Both postgres.bki and schemapg.h have entries corresponding
+ # to user attributes
+ my $attnum = 0;
+ my @user_attrs = @{ $table->{columns} };
+ foreach my $attr (@user_attrs)
+ {
+ $attnum++;
+ my $row = emit_pgattr_row($table_name, $attr);
+ $row->{attnum} = $attnum;
+ $row->{attstattarget} = '-1';
+
+ # Of the nailed-in-cache tables, only bootstrapped ones
+ # have data declarations in postgres.bki
+ if ($is_bootstrap eq ' bootstrap')
+ {
+ bki_insert($row, @attnames);
+ }
+
+ $row = emit_schemapg_row($row, grep { $bki_attr{$_} eq 'bool' } @attnames);
+
+ # Store schemapg entries for later
+ push @{ $schemapg_entries{$table_name} },
+ '{ ' . join(', ', map $row->{$_}, @attnames) . ' }';
+ }
+
+ # Only postgres.bki has entries corresponding to system
+ # attributes, so only bootstrapped relations here
+ if ($is_bootstrap eq ' bootstrap')
+ {
+ $attnum = 0;
+ my @SYS_ATTRS = (
+ {ctid => 'tid'},
+ {oid => 'oid'},
+ {xmin => 'xid'},
+ {cmin => 'cid'},
+ {xmax => 'xid'},
+ {cmax => 'cid'},
+ {tableoid => 'oid'}
+ );
+ foreach my $attr (@SYS_ATTRS)
+ {
+ $attnum--;
+ my $row = emit_pgattr_row($table_name, $attr);
+
+ # pg_attribute has no oids -- skip
+ next if $table_name eq 'pg_attribute' && $row->{attname} eq 'oid';
+
+ $row->{attnum} = $attnum;
+ $row->{attstattarget} = '0';
+ bki_insert($row, @attnames);
+ }
+ }
+ }
+ }
+ elsif (defined $catalog->{data})
+ {
+ foreach my $row ( @{ $catalog->{data} } )
+ {
+ $row->{bki_values} =~ s/\bPGUID\b/$BOOTSTRAP_SUPERUSERID/g;
+ $row->{bki_values} =~ s/\bPGNSP\b/$PG_CATALOG_NAMESPACE/g;
+
+ # Save type info for pg_attribute
+ if ($catname eq 'pg_type')
+ {
+ my %type;
+ @type{@attnames} = split /\s+/, $row->{bki_values};
+ $type{oid} = $row->{oid};
+ push @types, \%type;
+ }
+
+ # Write to postgres.bki
+ my $oid = $row->{oid} ? "OID = $row->{oid} " : '';
+ printf BKI "insert %s( %s)\n", $oid, $row->{bki_values};
+
+ # Write values to postgres.description and postgres.shdescription
+ if (defined $row->{descr})
+ {
+ printf DESCR "%s\t%s\t0\t%s\n", $row->{oid}, $catname, $row->{descr};
+ }
+ if (defined $row->{shdescr})
+ {
+ printf SHDESCR "%s\t%s\t%s\n", $row->{oid}, $catname, $row->{shdescr};
+ }
+ }
+ }
+ print BKI "close $catname\n";
+ }
+
+ # Any information needed for the BKI that is not contained in a pg_*.h header
+ # (i.e., not contained in a header with a CATALOG() statement) comes here
+ #
+ # Write out declare toast/index statements
+ foreach my $declaration ( @{ $catalogs->{toasting}->{data} } )
+ {
+ print BKI $declaration;
+ }
+
+ foreach my $declaration ( @{ $catalogs->{indexing}->{data} } )
+ {
+ print BKI $declaration;
+ }
+
+ print BKI "build indices\n";
+
+ # Opening boilerplate for schemapg.h
+ print SCHEMAPG <<EOM;
+ /*-------------------------------------------------------------------------
+ *
+ * schemapg.h
+ * Schema_pg_xxx macros for use by relcache.c
+ *
+ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * NOTES
+ * ******************************
+ * *** DO NOT EDIT THIS FILE! ***
+ * ******************************
+ *
+ * It has been GENERATED by $0
+ *
+ *-------------------------------------------------------------------------
+ */
+ #ifndef SCHEMAPG_H
+ #define SCHEMAPG_H
+ EOM
+
+ # Emit schemapg declarations
+ foreach my $table_name (@cached_tables)
+ {
+ print SCHEMAPG "\n#define Schema_$table_name \\\n";
+ print SCHEMAPG join ", \\\n", @{ $schemapg_entries{$table_name} };
+ print SCHEMAPG "\n";
+ }
+
+ # Closing boilerplate for schemapg.h
+ print SCHEMAPG "\n#endif /* SCHEMAPG_H */\n";
+
+ close BKI;
+ close DESCR;
+ close SHDESCR;
+ close SCHEMAPG;
+
+ # If OK, then rename temp files on top of final files, if
+ # they have changed
+ Catalog::RenameTempFile($output_path . 'postgres.bki');
+ Catalog::RenameTempFile($output_path . 'postgres.description');
+ Catalog::RenameTempFile($output_path . 'postgres.shdescription');
+ Catalog::RenameTempFile($output_path . 'schemapg.h');
+
+ #################### Subroutines ########################
+
+ # Given a system catalog name and a reference to a key-value pair corresponding
+ # to the name and type of a column, generate a reference to a pg_attribute entry
+ sub emit_pgattr_row
+ {
+ my ($table_name, $attr) = @_;
+ my ($attname, $atttype) = %$attr;
+ my %row;
+
+ $row{attrelid} = $catalogs->{$table_name}->{relation_oid};
+ $row{attname} = $attname;
+
+ # Adjust name for arrays: foo[] becomes _foo
+ # so we can look it up in pg_type
+ if ($atttype =~ /(.+)\[\]$/)
+ {
+ $atttype = '_' . $1;
+ }
+
+ # Copy the type data from pg_type, with two modifications:
+ foreach my $type (@types)
+ {
+ if ( defined $type->{typname} && $type->{typname} eq $atttype )
+ {
+ $row{atttypid} = $type->{oid};
+ $row{attlen} = $type->{typlen};
+ $row{attbyval} = $type->{typbyval};
+ $row{attstorage} = $type->{typstorage};
+ $row{attalign} = $type->{typalign};
+ $row{attndims} = $type->{typcategory} eq 'A' ? '1' : '0';
+ $row{attnotnull} = $type->{typstorage} eq 'x' ? 'f' : 't';
+ last;
+ }
+ }
+
+ # Default values for pg_attribute are added in
+ my %defaults = (
+ attdistinct => '0',
+ attcacheoff => '-1',
+ atttypmod => '-1',
+ atthasdef => 'f',
+ attisdropped => 'f',
+ attislocal => 't',
+ attinhcount => '0',
+ attacl => '_null_'
+ );
+ return {%defaults, %row};
+ }
+
+ # Write a pg_attribute entry to postgres.bki
+ sub bki_insert
+ {
+ my $row = shift;
+ my @attnames = @_;
+ my $oid = $row->{oid} ? "OID = $row->{oid} " : '';
+ my $bki_values = join ' ', map $row->{$_}, @attnames;
+ printf BKI "insert %s( %s)\n", $oid, $bki_values;
+ }
+
+ # The values of a Schema_pg_xxx declaration are similar, but not
+ # identical to, the corresponding values in pg_attribute
+ sub emit_schemapg_row
+ {
+ my $row = shift;
+ my @bool_attrs = @_;
+
+ # pg_index has attrelid = 0 in schemapg.h
+ if ($row->{attrelid} eq '2610')
+ {
+ $row->{attrelid} = '0';
+ }
+
+ $row->{attname} = q|{"| . $row->{attname} . q|"}|;
+ $row->{attstorage} = q|'| . $row->{attstorage} . q|'|;
+ $row->{attalign} = q|'| . $row->{attalign} . q|'|;
+ $row->{attacl} = q|{ 0 }|;
+
+ # Expand booleans, accounting for FLOAT4PASSBYVAL etc.
+ foreach my $attr (@bool_attrs)
+ {
+ $row->{$attr} =
+ $row->{$attr} eq 't' ? 'true'
+ : $row->{$attr} eq 'f' ? 'false'
+ : $row->{$attr};
+ }
+ return $row;
+ }
+
+ # Find a symbol defined in a particular header file and extract the value.
+ sub find_defined_symbol
+ {
+ my ($catalog_header, $symbol) = @_;
+ for my $path (@include_path)
+ {
+ my $file = $path . '/catalog/' . $catalog_header;
+ next if !-f $file;
+ open(FIND_DEFINED_SYMBOL, '<', $file) || die "$file: $!";
+ while (<FIND_DEFINED_SYMBOL>)
+ {
+ if (/^#define\s+\Q$symbol\E\s+(\S+)/)
+ {
+ return $1;
+ }
+ }
+ close FIND_DEFINED_SYMBOL;
+ die "$file: no definition found for $symbol\n";
+ }
+ die "$catalog_header: not found in any include directory\n";
+ }
+
+ sub usage
+ {
+ die <<EOM;
+ Usage: gen_bki.pl [options] header...
+
+ Options:
+ -I path to include files
+ -o output path
+ --set-version PostgreSQL version number for initdb cross-check
+
+ gen_bki.pl generates BKI files from specially formatted
+ header files. These BKI files are used to initialize the
+ postgres template database.
+
+ Report bugs to <pgsql-bugs\@postgresql.org>.
+ EOM
+ }
diff --git a/src/backend/catalog/genbki.sh b/src/backend/catalog/genbki.sh
index 9e0232c..e69de29 100644
*** a/src/backend/catalog/genbki.sh
--- b/src/backend/catalog/genbki.sh
***************
*** 1,438 ****
- #! /bin/sh
- #-------------------------------------------------------------------------
- #
- # genbki.sh--
- # shell script which generates .bki files from specially formatted .h
- # files. These .bki files are used to initialize the postgres template
- # database.
- #
- # Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
- # Portions Copyright (c) 1994, Regents of the University of California
- #
- #
- # IDENTIFICATION
- # $PostgreSQL$
- #
- # NOTES
- # non-essential whitespace is removed from the generated file.
- # if this is ever a problem, then the sed script at the very
- # end can be changed into another awk script or something smarter.
- #
- #-------------------------------------------------------------------------
-
- : ${AWK='awk'}
-
- CMDNAME=`basename $0`
-
- INCLUDE_DIRS=
- OUTPUT_PREFIX=
- INFILES=
- major_version=
-
- #
- # Process command line switches.
- #
- while [ $# -gt 0 ]
- do
- case $1 in
- -I)
- INCLUDE_DIRS="$INCLUDE_DIRS $2"
- shift;;
- -I*)
- arg=`echo $1 | sed -e 's/^-I//'`
- INCLUDE_DIRS="$INCLUDE_DIRS $arg"
- ;;
- -o)
- OUTPUT_PREFIX="$2"
- shift;;
- -o*)
- OUTPUT_PREFIX=`echo $1 | sed -e 's/^-o//'`
- ;;
- --set-version=*)
- arg=`expr x"$1" : x"--set-version=\(.*\)"`
- major_version=`expr x"$arg" : x'\([0-9][0-9]*\.[0-9][0-9]*\)'`
- ;;
- --help)
- echo "$CMDNAME generates system catalog bootstrapping files."
- echo
- echo "Usage:"
- echo " $CMDNAME [ -I dir ] --set-version=VERSION -o prefix files..."
- echo
- echo "Options:"
- echo " -I path to include files"
- echo " -o prefix of output files"
- echo " --set-version PostgreSQL version number for initdb cross-check"
- echo
- echo "The environment variable AWK determines which Awk program"
- echo "to use. The default is \`awk'."
- echo
- echo "Report bugs to <pgsql-bugs@postgresql.org>."
- exit 0
- ;;
- -*)
- echo "$CMDNAME: invalid option: $1"
- exit 1
- ;;
- *)
- INFILES="$INFILES $1"
- ;;
- esac
- shift
- done
-
- if [ x"$INFILES" = x"" ] ; then
- echo "$CMDNAME: no input files" 1>&2
- exit 1
- fi
-
- if [ x"$OUTPUT_PREFIX" = x"" ] ; then
- echo "$CMDNAME: no output prefix specified" 1>&2
- exit 1
- fi
-
- if [ x"$INCLUDE_DIRS" = x"" ] ; then
- echo "$CMDNAME: path to include directory unknown" 1>&2
- exit 1
- fi
-
- if [ x"$major_version" = x"" ] ; then
- echo "$CMDNAME: invalid or no version number specified" 1>&2
- exit 1
- fi
-
-
- TMPFILE="genbkitmp$$.c"
-
- trap "rm -f $TMPFILE ${OUTPUT_PREFIX}.bki.$$ ${OUTPUT_PREFIX}.description.$$ ${OUTPUT_PREFIX}.shdescription.$$" 0 1 2 3 15
-
-
- # CAUTION: be wary about what symbols you substitute into the .bki file here!
- # It's okay to substitute things that are expected to be really constant
- # within a given Postgres release, such as fixed OIDs. Do not substitute
- # anything that could depend on platform or configuration. (The right place
- # to handle those sorts of things is in initdb.c's bootstrap_template1().)
-
- # Get BOOTSTRAP_SUPERUSERID from catalog/pg_authid.h
- for dir in $INCLUDE_DIRS; do
- if [ -f "$dir/catalog/pg_authid.h" ]; then
- BOOTSTRAP_SUPERUSERID=`grep '^#define[ ]*BOOTSTRAP_SUPERUSERID' $dir/catalog/pg_authid.h | $AWK '{ print $3 }'`
- break
- fi
- done
-
- # Get PG_CATALOG_NAMESPACE from catalog/pg_namespace.h
- for dir in $INCLUDE_DIRS; do
- if [ -f "$dir/catalog/pg_namespace.h" ]; then
- PG_CATALOG_NAMESPACE=`grep '^#define[ ]*PG_CATALOG_NAMESPACE' $dir/catalog/pg_namespace.h | $AWK '{ print $3 }'`
- break
- fi
- done
-
- touch ${OUTPUT_PREFIX}.description.$$
- touch ${OUTPUT_PREFIX}.shdescription.$$
-
- # ----------------
- # Strip comments and other trash from .h
- #
- # Put multi-line start/end comments on a separate line
- #
- # Rename datatypes that have different names in .h files than in SQL
- #
- # Substitute values of configuration constants
- # ----------------
- #
- cat $INFILES | \
- sed -e 's;/\*.*\*/;;g' \
- -e 's;/\*;\
- /*\
- ;g' \
- -e 's;\*/;\
- */\
- ;g' | # we must run a new sed here to see the newlines we added
- sed -e "s/;[ ]*$//g" \
- -e "s/^[ ]*//" \
- -e "s/[ ]Oid/ oid/g" \
- -e "s/^Oid/oid/g" \
- -e "s/(Oid/(oid/g" \
- -e "s/[ ]NameData/ name/g" \
- -e "s/^NameData/name/g" \
- -e "s/(NameData/(name/g" \
- -e "s/[ ]TransactionId/ xid/g" \
- -e "s/^TransactionId/xid/g" \
- -e "s/(TransactionId/(xid/g" \
- -e "s/PGUID/$BOOTSTRAP_SUPERUSERID/g" \
- -e "s/PGNSP/$PG_CATALOG_NAMESPACE/g" \
- | $AWK '
- # ----------------
- # now use awk to process remaining .h file..
- #
- # nc is the number of catalogs
- # inside is a variable set to 1 when we are scanning the
- # contents of a catalog definition.
- # reln_open is a flag indicating when we are processing DATA lines.
- # (i.e. have a relation open and need to close it)
- # oid is the most recently seen oid, or 0 if none in the last DATA line.
- # ----------------
- BEGIN {
- inside = 0;
- bootstrap = "";
- shared_relation = "";
- without_oids = "";
- rowtype_oid = "";
- nc = 0;
- reln_open = 0;
- comment_level = 0;
- oid = 0;
- }
-
- # ----------------
- # Anything in a /* .. */ block should be ignored.
- # Blank lines also go.
- # Note that any /* */ comment on a line by itself was removed from the line
- # by the sed above.
- # ----------------
- /^\/\*/ { comment_level += 1; next; }
- /^\*\// { comment_level -= 1; next; }
- comment_level > 0 { next; }
-
- /^[ ]*$/ { next; }
-
- # ----------------
- # DATA() statements are basically passed right through after
- # stripping off the DATA( and the ) on the end.
- # Remember the OID for use by DESCR() and SHDESCR().
- # ----------------
- /^DATA\(/ {
- data = substr($0, 6, length($0) - 6);
- oid = 0;
- nf = split(data, datafields);
- if (nf >= 4 && datafields[1] == "insert" && datafields[2] == "OID" && datafields[3] == "=")
- {
- oid = datafields[4];
- }
- print data;
- next;
- }
-
- /^DESCR\(/ {
- if (oid != 0)
- {
- data = substr($0, 8, length($0) - 9);
- if (data != "")
- printf "%d\t%s\t0\t%s\n", oid, catalog, data >>descriptionfile;
- }
- next;
- }
-
- /^SHDESCR\(/ {
- if (oid != 0)
- {
- data = substr($0, 10, length($0) - 11);
- if (data != "")
- printf "%d\t%s\t%s\n", oid, catalog, data >>shdescriptionfile;
- }
- next;
- }
-
- /^DECLARE_INDEX\(/ {
- # ----
- # end any prior catalog data insertions before starting a define index
- # ----
- if (reln_open == 1) {
- print "close " catalog;
- reln_open = 0;
- }
-
- data = substr($0, 15, length($0) - 15);
- pos = index(data, ",");
- iname = substr(data, 1, pos-1);
- data = substr(data, pos+1, length(data)-pos);
- pos = index(data, ",");
- oid = substr(data, 1, pos-1);
- data = substr(data, pos+1, length(data)-pos);
-
- print "declare index " iname " " oid " " data
- }
-
- /^DECLARE_UNIQUE_INDEX\(/ {
- # ----
- # end any prior catalog data insertions before starting a define unique index
- # ----
- if (reln_open == 1) {
- print "close " catalog;
- reln_open = 0;
- }
-
- data = substr($0, 22, length($0) - 22);
- pos = index(data, ",");
- iname = substr(data, 1, pos-1);
- data = substr(data, pos+1, length(data)-pos);
- pos = index(data, ",");
- oid = substr(data, 1, pos-1);
- data = substr(data, pos+1, length(data)-pos);
-
- print "declare unique index " iname " " oid " " data
- }
-
- /^DECLARE_TOAST\(/ {
- # ----
- # end any prior catalog data insertions before starting a define toast
- # ----
- if (reln_open == 1) {
- print "close " catalog;
- reln_open = 0;
- }
-
- data = substr($0, 15, length($0) - 15);
- pos = index(data, ",");
- tname = substr(data, 1, pos-1);
- data = substr(data, pos+1, length(data)-pos);
- pos = index(data, ",");
- toastoid = substr(data, 1, pos-1);
- data = substr(data, pos+1, length(data)-pos);
- # previous commands already removed the trailing );
- indexoid = data;
-
- print "declare toast " toastoid " " indexoid " on " tname
- }
-
- /^BUILD_INDICES/ { print "build indices"; }
-
- # ----------------
- # CATALOG() definitions take some more work.
- # ----------------
- /^CATALOG\(/ {
- # ----
- # end any prior catalog data insertions before starting a new one..
- # ----
- if (reln_open == 1) {
- print "close " catalog;
- reln_open = 0;
- }
-
- # ----
- # get the name and properties of the new catalog
- # ----
- pos = index($1,")");
- catalogandoid = substr($1,9,pos-9);
- pos = index(catalogandoid, ",");
- catalog = substr(catalogandoid, 1, pos-1);
- oid = substr(catalogandoid, pos+1, length(catalogandoid)-pos);
-
- if ($0 ~ /BKI_BOOTSTRAP/) {
- bootstrap = " bootstrap";
- }
- if ($0 ~ /BKI_SHARED_RELATION/) {
- shared_relation = " shared_relation";
- }
- if ($0 ~ /BKI_WITHOUT_OIDS/) {
- without_oids = " without_oids";
- }
- if ($0 ~ /BKI_ROWTYPE_OID\([0-9]*\)/) {
- tmp = $0;
- sub(/^.*BKI_ROWTYPE_OID\(/, "", tmp);
- sub(/\).*$/, "", tmp);
- rowtype_oid = " rowtype_oid " tmp;
- }
-
- i = 1;
- inside = 1;
- nc++;
- next;
- }
-
- # ----------------
- # process the columns of the catalog definition
- #
- # attname[ x ] contains the attribute name for attribute x
- # atttype[ x ] contains the attribute type fot attribute x
- # ----------------
- inside == 1 {
- # ----
- # ignore a leading brace line..
- # ----
- if ($1 ~ /\{/)
- next;
-
- # ----
- # if this is the last line, then output the bki catalog stuff.
- # ----
- if ($1 ~ /}/) {
- print "create " catalog " " oid bootstrap shared_relation without_oids rowtype_oid;
- print "\t(";
-
- for (j=1; j<i-1; j++) {
- print "\t " attname[ j ] " = " atttype[ j ] " ,";
- }
- print "\t " attname[ j ] " = " atttype[ j ] ;
- print "\t)";
-
- if (bootstrap == "") {
- print "open " catalog;
- }
-
- i = 1;
- reln_open = 1;
- inside = 0;
- bootstrap = "";
- shared_relation = "";
- without_oids = "";
- rowtype_oid = "";
- next;
- }
-
- # ----
- # we are inside the catalog definition, so keep sucking up
- # attribute names and types
- # ----
- if ($2 ~ /\[.*\]/) { # array attribute
- idlen = index($2,"[") - 1;
- atttype[ i ] = $1 "[]"; # variable-length only..
- attname[ i ] = substr($2,1,idlen);
- } else {
- atttype[ i ] = $1;
- attname[ i ] = $2;
- }
- i++;
- next;
- }
-
- END {
- if (reln_open == 1) {
- print "close " catalog;
- reln_open = 0;
- }
- }
- ' "descriptionfile=${OUTPUT_PREFIX}.description.$$" "shdescriptionfile=${OUTPUT_PREFIX}.shdescription.$$" > $TMPFILE || exit
-
- echo "# PostgreSQL $major_version" >${OUTPUT_PREFIX}.bki.$$
-
- sed -e '/^[ ]*$/d' \
- -e 's/[ ][ ]*/ /g' $TMPFILE >>${OUTPUT_PREFIX}.bki.$$ || exit
-
- #
- # Sanity check: if one of the sed/awk/etc commands fails, we'll probably
- # end up with a .bki file that is empty or just a few lines. Cross-check
- # that the files are of reasonable size. The numbers here are arbitrary,
- # but are much smaller than the actual expected sizes as of Postgres 7.2.
- #
- if [ `wc -c < ${OUTPUT_PREFIX}.bki.$$` -lt 100000 ]; then
- echo "$CMDNAME: something seems to be wrong with the .bki file" >&2
- exit 1
- fi
- if [ `wc -c < ${OUTPUT_PREFIX}.description.$$` -lt 10000 ]; then
- echo "$CMDNAME: something seems to be wrong with the .description file" >&2
- exit 1
- fi
- if [ `wc -c < ${OUTPUT_PREFIX}.shdescription.$$` -lt 10 ]; then
- echo "$CMDNAME: something seems to be wrong with the .shdescription file" >&2
- exit 1
- fi
-
- # Looks good, commit ...
-
- mv ${OUTPUT_PREFIX}.bki.$$ ${OUTPUT_PREFIX}.bki || exit
- mv ${OUTPUT_PREFIX}.description.$$ ${OUTPUT_PREFIX}.description || exit
- mv ${OUTPUT_PREFIX}.shdescription.$$ ${OUTPUT_PREFIX}.shdescription || exit
-
- exit 0
--- 0 ----
diff --git a/src/backend/utils/Gen_fmgrtab.pl b/src/backend/utils/Gen_fmgrtab.pl
index 1f3e6a4..e69de29 100644
*** a/src/backend/utils/Gen_fmgrtab.pl
--- b/src/backend/utils/Gen_fmgrtab.pl
***************
*** 1,194 ****
- #! /usr/bin/perl -w
- #-------------------------------------------------------------------------
- #
- # Gen_fmgrtab.pl
- # Perl equivalent of Gen_fmgrtab.sh
- #
- # Usage: perl Gen_fmgrtab.pl path-to-pg_proc.h
- #
- # The reason for implementing this functionality twice is that we don't
- # require people to have perl to build from a tarball, but on the other
- # hand Windows can't deal with shell scripts.
- #
- # Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
- # Portions Copyright (c) 1994, Regents of the University of California
- #
- #
- # IDENTIFICATION
- # $PostgreSQL$
- #
- #-------------------------------------------------------------------------
-
- use strict;
- use warnings;
-
- # Collect arguments
- my $infile = shift;
- defined($infile) || die "$0: missing required argument: pg_proc.h\n";
-
- # Note: see Gen_fmgrtab.sh for detailed commentary on what this is doing
-
- # Collect column numbers for pg_proc columns we need
- my ($proname, $prolang, $proisstrict, $proretset, $pronargs, $prosrc);
-
- open(I, $infile) || die "Could not open $infile: $!";
- while (<I>)
- {
- if (m/#define Anum_pg_proc_proname\s+(\d+)/) {
- $proname = $1;
- }
- if (m/#define Anum_pg_proc_prolang\s+(\d+)/) {
- $prolang = $1;
- }
- if (m/#define Anum_pg_proc_proisstrict\s+(\d+)/) {
- $proisstrict = $1;
- }
- if (m/#define Anum_pg_proc_proretset\s+(\d+)/) {
- $proretset = $1;
- }
- if (m/#define Anum_pg_proc_pronargs\s+(\d+)/) {
- $pronargs = $1;
- }
- if (m/#define Anum_pg_proc_prosrc\s+(\d+)/) {
- $prosrc = $1;
- }
- }
- close(I);
-
- # Collect the raw data
- my @fmgr = ();
-
- open(I, $infile) || die "Could not open $infile: $!";
- while (<I>)
- {
- next unless (/^DATA/);
- s/^[^O]*OID[^=]*=[ \t]*//;
- s/\(//;
- s/"[^"]*"/"xxx"/g;
- my @p = split;
- next if ($p[$prolang] ne "12");
- push @fmgr,
- {
- oid => $p[0],
- proname => $p[$proname],
- strict => $p[$proisstrict],
- retset => $p[$proretset],
- nargs => $p[$pronargs],
- prosrc => $p[$prosrc],
- };
- }
- close(I);
-
- # Emit headers for both files
- open(H, '>', "$$-fmgroids.h") || die "Could not open $$-fmgroids.h: $!";
- print H
- qq|/*-------------------------------------------------------------------------
- *
- * fmgroids.h
- * Macros that define the OIDs of built-in functions.
- *
- * These macros can be used to avoid a catalog lookup when a specific
- * fmgr-callable function needs to be referenced.
- *
- * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
- * Portions Copyright (c) 1994, Regents of the University of California
- *
- * NOTES
- * ******************************
- * *** DO NOT EDIT THIS FILE! ***
- * ******************************
- *
- * It has been GENERATED by $0
- * from $infile
- *
- *-------------------------------------------------------------------------
- */
- #ifndef FMGROIDS_H
- #define FMGROIDS_H
-
- /*
- * Constant macros for the OIDs of entries in pg_proc.
- *
- * NOTE: macros are named after the prosrc value, ie the actual C name
- * of the implementing function, not the proname which may be overloaded.
- * For example, we want to be able to assign different macro names to both
- * char_text() and name_text() even though these both appear with proname
- * 'text'. If the same C function appears in more than one pg_proc entry,
- * its equivalent macro will be defined with the lowest OID among those
- * entries.
- */
- |;
-
- open(T, '>', "$$-fmgrtab.c") || die "Could not open $$-fmgrtab.c: $!";
- print T
- qq|/*-------------------------------------------------------------------------
- *
- * fmgrtab.c
- * The function manager's table of internal functions.
- *
- * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
- * Portions Copyright (c) 1994, Regents of the University of California
- *
- * NOTES
- *
- * ******************************
- * *** DO NOT EDIT THIS FILE! ***
- * ******************************
- *
- * It has been GENERATED by $0
- * from $infile
- *
- *-------------------------------------------------------------------------
- */
-
- #include "postgres.h"
-
- #include "utils/fmgrtab.h"
-
- |;
-
- # Emit #define's and extern's -- only one per prosrc value
- my %seenit;
- foreach my $s (sort {$a->{oid} <=> $b->{oid}} @fmgr)
- {
- next if $seenit{$s->{prosrc}};
- $seenit{$s->{prosrc}} = 1;
- print H "#define F_" . uc $s->{prosrc} . " $s->{oid}\n";
- print T "extern Datum $s->{prosrc} (PG_FUNCTION_ARGS);\n";
- }
-
- # Create the fmgr_builtins table
- print T "\nconst FmgrBuiltin fmgr_builtins[] = {\n";
- my %bmap;
- $bmap{'t'} = 'true';
- $bmap{'f'} = 'false';
- foreach my $s (sort {$a->{oid} <=> $b->{oid}} @fmgr)
- {
- print T
- " { $s->{oid}, \"$s->{prosrc}\", $s->{nargs}, $bmap{$s->{strict}}, $bmap{$s->{retset}}, $s->{prosrc} },\n";
- }
-
- # And add the file footers.
- print H "\n#endif /* FMGROIDS_H */\n";
- close(H);
-
- print T
- qq| /* dummy entry is easier than getting rid of comma after last real one */
- /* (not that there has ever been anything wrong with *having* a
- comma after the last field in an array initializer) */
- { 0, NULL, 0, false, false, NULL }
- };
-
- /* Note fmgr_nbuiltins excludes the dummy entry */
- const int fmgr_nbuiltins = (sizeof(fmgr_builtins) / sizeof(FmgrBuiltin)) - 1;
- |;
-
- close(T);
-
- # Finally, rename the completed files into place.
- rename "$$-fmgroids.h", "fmgroids.h"
- || die "Could not rename $$-fmgroids.h to fmgroids.h: $!";
- rename "$$-fmgrtab.c", "fmgrtab.c"
- || die "Could not rename $$-fmgrtab.c to fmgrtab.c: $!";
-
- exit 0;
--- 0 ----
diff --git a/src/backend/utils/Gen_fmgrtab.sh b/src/backend/utils/Gen_fmgrtab.sh
index 9cbe5d2..e69de29 100644
*** a/src/backend/utils/Gen_fmgrtab.sh
--- b/src/backend/utils/Gen_fmgrtab.sh
***************
*** 1,253 ****
- #! /bin/sh
- #-------------------------------------------------------------------------
- #
- # Gen_fmgrtab.sh
- # shell script to generate fmgroids.h and fmgrtab.c from pg_proc.h
- #
- # NOTE: if you change this, you need to fix Gen_fmgrtab.pl too!
- #
- # Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
- # Portions Copyright (c) 1994, Regents of the University of California
- #
- #
- # IDENTIFICATION
- # $PostgreSQL$
- #
- #-------------------------------------------------------------------------
-
- CMDNAME=`basename $0`
-
- if [ x"$AWK" = x"" ]; then
- AWK=awk
- fi
-
- cleanup(){
- [ x"$noclean" != x"t" ] && rm -f "$SORTEDFILE" "$$-$OIDSFILE" "$$-$TABLEFILE"
- }
-
- noclean=
-
- #
- # Process command line switches.
- #
- while [ $# -gt 0 ]
- do
- case $1 in
- --noclean)
- noclean=t
- ;;
- --help)
- echo "$CMDNAME generates fmgroids.h and fmgrtab.c from pg_proc.h."
- echo
- echo "Usage:"
- echo " $CMDNAME inputfile"
- echo
- echo "The environment variable AWK determines which Awk program"
- echo "to use. The default is \`awk'."
- echo
- echo "Report bugs to <pgsql-bugs@postgresql.org>."
- exit 0
- ;;
- -*)
- echo "$CMDNAME: invalid option: $1"
- exit 1
- ;;
- *)
- INFILE=$1
- ;;
- esac
- shift
- done
-
-
- if [ x"$INFILE" = x ] ; then
- echo "$CMDNAME: no input file"
- exit 1
- fi
-
- SORTEDFILE="$$-fmgr.data"
- OIDSFILE=fmgroids.h
- TABLEFILE=fmgrtab.c
-
-
- trap 'echo "Caught signal." ; cleanup ; exit 1' 1 2 15
-
- #
- # Collect the column numbers of the pg_proc columns we need. Because we will
- # be looking at data that includes the OID as the first column, add one to
- # each column number.
- #
- proname=`egrep '^#define Anum_pg_proc_proname[ ]' $INFILE | $AWK '{print $3+1}'`
- prolang=`egrep '^#define Anum_pg_proc_prolang[ ]' $INFILE | $AWK '{print $3+1}'`
- proisstrict=`egrep '^#define Anum_pg_proc_proisstrict[ ]' $INFILE | $AWK '{print $3+1}'`
- proretset=`egrep '^#define Anum_pg_proc_proretset[ ]' $INFILE | $AWK '{print $3+1}'`
- pronargs=`egrep '^#define Anum_pg_proc_pronargs[ ]' $INFILE | $AWK '{print $3+1}'`
- prosrc=`egrep '^#define Anum_pg_proc_prosrc[ ]' $INFILE | $AWK '{print $3+1}'`
-
- #
- # Generate the file containing raw pg_proc data. We do three things here:
- # 1. Strip off the DATA macro call, leaving procedure OID as $1
- # and all the pg_proc field values as $2, $3, etc on each line.
- # 2. Fold quoted fields to simple "xxx". We need this because such fields
- # may contain whitespace, which would confuse awk's counting of fields.
- # Fortunately, this script doesn't need to look at any fields that might
- # need quoting, so this simple hack is sufficient.
- # 3. Select out just the rows for internal-language procedures.
- #
- # Note assumption here that INTERNALlanguageId == 12.
- #
- egrep '^DATA' $INFILE | \
- sed -e 's/^[^O]*OID[^=]*=[ ]*//' \
- -e 's/(//' \
- -e 's/"[^"]*"/"xxx"/g' | \
- $AWK "\$$prolang == \"12\" { print }" | \
- sort -n > $SORTEDFILE
-
- if [ $? -ne 0 ]; then
- cleanup
- echo "$CMDNAME failed"
- exit 1
- fi
-
-
- cpp_define=`echo $OIDSFILE | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | sed -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
-
- #
- # Generate fmgroids.h
- #
- cat > "$$-$OIDSFILE" <<FuNkYfMgRsTuFf
- /*-------------------------------------------------------------------------
- *
- * $OIDSFILE
- * Macros that define the OIDs of built-in functions.
- *
- * These macros can be used to avoid a catalog lookup when a specific
- * fmgr-callable function needs to be referenced.
- *
- * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
- * Portions Copyright (c) 1994, Regents of the University of California
- *
- * NOTES
- * ******************************
- * *** DO NOT EDIT THIS FILE! ***
- * ******************************
- *
- * It has been GENERATED by $CMDNAME
- * from $INFILE
- *
- *-------------------------------------------------------------------------
- */
- #ifndef $cpp_define
- #define $cpp_define
-
- /*
- * Constant macros for the OIDs of entries in pg_proc.
- *
- * NOTE: macros are named after the prosrc value, ie the actual C name
- * of the implementing function, not the proname which may be overloaded.
- * For example, we want to be able to assign different macro names to both
- * char_text() and name_text() even though these both appear with proname
- * 'text'. If the same C function appears in more than one pg_proc entry,
- * its equivalent macro will be defined with the lowest OID among those
- * entries.
- */
- FuNkYfMgRsTuFf
-
- tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' < $SORTEDFILE | \
- $AWK "{ if (seenit[\$$prosrc]++ == 0)
- printf \"#define F_%s %s\\n\", \$$prosrc, \$1; }" >> "$$-$OIDSFILE"
-
- if [ $? -ne 0 ]; then
- cleanup
- echo "$CMDNAME failed"
- exit 1
- fi
-
- cat >> "$$-$OIDSFILE" <<FuNkYfMgRsTuFf
-
- #endif /* $cpp_define */
- FuNkYfMgRsTuFf
-
- #
- # Generate fmgr's built-in-function table.
- #
- # Print out the function declarations, then the table that refers to them.
- #
- cat > "$$-$TABLEFILE" <<FuNkYfMgRtAbStUfF
- /*-------------------------------------------------------------------------
- *
- * $TABLEFILE
- * The function manager's table of internal functions.
- *
- * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
- * Portions Copyright (c) 1994, Regents of the University of California
- *
- * NOTES
- *
- * ******************************
- * *** DO NOT EDIT THIS FILE! ***
- * ******************************
- *
- * It has been GENERATED by $CMDNAME
- * from $INFILE
- *
- *-------------------------------------------------------------------------
- */
-
- #include "postgres.h"
-
- #include "utils/fmgrtab.h"
-
- FuNkYfMgRtAbStUfF
-
- $AWK "{ if (seenit[\$$prosrc]++ == 0)
- print \"extern Datum\", \$$prosrc, \"(PG_FUNCTION_ARGS);\"; }" $SORTEDFILE >> "$$-$TABLEFILE"
-
- if [ $? -ne 0 ]; then
- cleanup
- echo "$CMDNAME failed"
- exit 1
- fi
-
-
- cat >> "$$-$TABLEFILE" <<FuNkYfMgRtAbStUfF
-
- const FmgrBuiltin fmgr_builtins[] = {
- FuNkYfMgRtAbStUfF
-
- # Note: using awk arrays to translate from pg_proc values to fmgrtab values
- # may seem tedious, but avoid the temptation to write a quick x?y:z
- # conditional expression instead. Not all awks have conditional expressions.
-
- $AWK "BEGIN {
- Bool[\"t\"] = \"true\";
- Bool[\"f\"] = \"false\";
- }
- { printf (\" { %d, \\\"%s\\\", %d, %s, %s, %s },\\n\"),
- \$1, \$$prosrc, \$$pronargs, Bool[\$$proisstrict], Bool[\$$proretset], \$$prosrc ;
- }" $SORTEDFILE >> "$$-$TABLEFILE"
-
- if [ $? -ne 0 ]; then
- cleanup
- echo "$CMDNAME failed"
- exit 1
- fi
-
- cat >> "$$-$TABLEFILE" <<FuNkYfMgRtAbStUfF
- /* dummy entry is easier than getting rid of comma after last real one */
- /* (not that there has ever been anything wrong with *having* a
- comma after the last field in an array initializer) */
- { 0, NULL, 0, false, false, NULL }
- };
-
- /* Note fmgr_nbuiltins excludes the dummy entry */
- const int fmgr_nbuiltins = (sizeof(fmgr_builtins) / sizeof(FmgrBuiltin)) - 1;
- FuNkYfMgRtAbStUfF
-
- # We use the temporary files to avoid problems with concurrent runs
- # (which can happen during parallel make).
- mv "$$-$OIDSFILE" $OIDSFILE
- mv "$$-$TABLEFILE" $TABLEFILE
-
- cleanup
- exit 0
--- 0 ----
diff --git a/src/backend/utils/Makefile b/src/backend/utils/Makefile
index faa7664..230fff4 100644
*** a/src/backend/utils/Makefile
--- b/src/backend/utils/Makefile
***************
*** 6,11 ****
--- 6,12 ----
subdir = src/backend/utils
top_builddir = ../../..
+ catalogdir = $(top_srcdir)/src/backend/catalog
include $(top_builddir)/src/Makefile.global
OBJS = fmgrtab.o
*************** all: fmgroids.h probes.h
*** 17,24 ****
$(SUBDIRS:%=%-recursive): fmgroids.h
! fmgroids.h fmgrtab.c: Gen_fmgrtab.sh $(top_srcdir)/src/include/catalog/pg_proc.h
! AWK='$(AWK)' $(SHELL) $< $(top_srcdir)/src/include/catalog/pg_proc.h
ifneq ($(enable_dtrace), yes)
probes.h: Gen_dummy_probes.sed
--- 18,29 ----
$(SUBDIRS:%=%-recursive): fmgroids.h
! # see explanation in ../parser/Makefile
! fmgroids.h: fmgrtab.c ;
!
! # We need to pass the location of Catalog.pm to the Perl interpreter
! fmgrtab.c: gen_fmgr.pl $(catalogdir)/Catalog.pm $(top_srcdir)/src/include/catalog/pg_proc.h
! $(PERL) -I $(catalogdir) $< -o $(srcdir) $(top_srcdir)/src/include/catalog/pg_proc.h
ifneq ($(enable_dtrace), yes)
probes.h: Gen_dummy_probes.sed
*************** endif
*** 35,38 ****
clean:
! rm -f fmgroids.h fmgrtab.c probes.h
--- 40,45 ----
clean:
! # fmgroids.h and fmgrtab.c are in the distribution tarball, so they
! # are not cleaned here.
! rm -f probes.h
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index eba7194..ad435d8 100644
*** a/src/backend/utils/cache/relcache.c
--- b/src/backend/utils/cache/relcache.c
***************
*** 50,55 ****
--- 50,56 ----
#include "catalog/pg_rewrite.h"
#include "catalog/pg_tablespace.h"
#include "catalog/pg_type.h"
+ #include "catalog/schemapg.h"
#include "commands/trigger.h"
#include "miscadmin.h"
#include "optimizer/clauses.h"
diff --git a/src/backend/utils/gen_fmgr.pl b/src/backend/utils/gen_fmgr.pl
index ...270ffea .
*** a/src/backend/utils/gen_fmgr.pl
--- b/src/backend/utils/gen_fmgr.pl
***************
*** 0 ****
--- 1,212 ----
+ #!/usr/bin/perl
+ #----------------------------------------------------------------------
+ #
+ # gen_fmgr.pl
+ # perl script which generates fmgroids.h and fmgrtab.c
+ # from catalog/pg_proc.h
+ #
+ # Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
+ # Portions Copyright (c) 1994, Regents of the University of California
+ #
+ # $PostgreSQL$
+ #
+ #----------------------------------------------------------------------
+
+ use strict;
+ use warnings;
+
+ # The location of Catalog.pm is passed to the Perl interpreter in utils/Makefile
+ use Catalog;
+
+ my $input_file; # pg_proc.h
+ my $output_path = '';
+ while (@ARGV)
+ {
+ my $arg = shift @ARGV;
+ if ($arg !~ /^-/)
+ {
+ $input_file = $arg;
+ }
+ elsif ($arg =~ /^-o/)
+ {
+ $output_path = length($arg) > 2 ? substr($arg, 2) : shift @ARGV;
+ }
+ else
+ {
+ usage();
+ }
+ }
+
+ # Make sure output_path ends in a slash.
+ if ($output_path ne '' && substr($output_path, -1) ne '/')
+ {
+ $output_path .= '/';
+ }
+
+ # Gather data from pg_proc.h
+ my $catalogs = Catalog::Catalogs($input_file);
+
+ my @attnames;
+ foreach my $column ( @{ $catalogs->{pg_proc}->{columns} } )
+ {
+ push @attnames, keys %$column;
+ }
+
+ my @fmgr = ();
+ my $data = $catalogs->{pg_proc}->{data};
+ foreach my $row (@$data)
+ {
+
+ # To construct fmgroids.h and fmgrtab.c, we need to inspect some
+ # of the individual data fields. Just splitting on whitespace
+ # won't work, because some quoted fields might contain internal
+ # whitespace. We handle this by folding them all to a simple
+ # "xxx". Fortunately, this script doesn't need to look at any
+ # fields that might need quoting, so this simple hack is
+ # sufficient.
+ $row->{bki_values} =~ s/"[^"]*"/"xxx"/g;
+ @{$row}{@attnames} = split /\s+/, $row->{bki_values};
+
+ # Note assumption here that INTERNALlanguageId == 12.
+ next if $row->{prolang} ne '12';
+
+ push @fmgr,
+ {
+ oid => $row->{oid},
+ strict => $row->{proisstrict},
+ retset => $row->{proretset},
+ nargs => $row->{pronargs},
+ prosrc => $row->{prosrc},
+ };
+ }
+
+ # Open temp files
+ open H, '>', $output_path . 'fmgroids.h.tmp'
+ || die "can't open fmgroids.h.tmp: $!";
+ open T, '>', $output_path . 'fmgrtab.c.tmp'
+ || die "can't open fmgrtab.c.tmp: $!";
+
+ # Opening boilerplate for fmgroids.h
+ print H <<EOM;
+ /*-------------------------------------------------------------------------
+ *
+ * fmgroids.h
+ * Macros that define the OIDs of built-in functions.
+ *
+ * These macros can be used to avoid a catalog lookup when a specific
+ * fmgr-callable function needs to be referenced.
+ *
+ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * NOTES
+ * ******************************
+ * *** DO NOT EDIT THIS FILE! ***
+ * ******************************
+ *
+ * It has been GENERATED by $0
+ * from $input_file
+ *
+ *-------------------------------------------------------------------------
+ */
+ #ifndef FMGROIDS_H
+ #define FMGROIDS_H
+
+ /*
+ * Constant macros for the OIDs of entries in pg_proc.
+ *
+ * NOTE: macros are named after the prosrc value, ie the actual C name
+ * of the implementing function, not the proname which may be overloaded.
+ * For example, we want to be able to assign different macro names to both
+ * char_text() and name_text() even though these both appear with proname
+ * 'text'. If the same C function appears in more than one pg_proc entry,
+ * its equivalent macro will be defined with the lowest OID among those
+ * entries.
+ */
+ EOM
+
+ # Opening boilerplate for fmgrtab.c
+ print T <<EOM;
+ /*-------------------------------------------------------------------------
+ *
+ * fmgrtab.c
+ * The function manager's table of internal functions.
+ *
+ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * NOTES
+ *
+ * ******************************
+ * *** DO NOT EDIT THIS FILE! ***
+ * ******************************
+ *
+ * It has been GENERATED by $0
+ * from $input_file
+ *
+ *-------------------------------------------------------------------------
+ */
+
+ #include "postgres.h"
+
+ #include "utils/fmgrtab.h"
+
+ EOM
+
+ # Emit #define's and extern's -- only one per prosrc value
+ my %seenit;
+ foreach my $s (sort {$a->{oid} <=> $b->{oid}} @fmgr)
+ {
+ next if $seenit{$s->{prosrc}};
+ $seenit{$s->{prosrc}} = 1;
+ print H "#define F_" . uc $s->{prosrc} . " $s->{oid}\n";
+ print T "extern Datum $s->{prosrc} (PG_FUNCTION_ARGS);\n";
+ }
+
+ # Create the fmgr_builtins table
+ print T "\nconst FmgrBuiltin fmgr_builtins[] = {\n";
+ my %bmap;
+ $bmap{'t'} = 'true';
+ $bmap{'f'} = 'false';
+ foreach my $s (sort {$a->{oid} <=> $b->{oid}} @fmgr)
+ {
+ print T qq[ { $s->{oid}, ]
+ . qq["$s->{prosrc}", ]
+ . qq[$s->{nargs}, ]
+ . qq[$bmap{$s->{strict}}, ]
+ . qq[$bmap{$s->{retset}}, ]
+ . qq[$s->{prosrc} },\n];
+ }
+
+ # And add the file footers.
+ print H "\n#endif /* FMGROIDS_H */\n";
+
+ print T <<EOM;
+ /* dummy entry is easier than getting rid of comma after last real one */
+ /* (not that there has ever been anything wrong with *having* a
+ comma after the last field in an array initializer) */
+ { 0, NULL, 0, false, false, NULL }
+ };
+
+ /* Note fmgr_nbuiltins excludes the dummy entry */
+ const int fmgr_nbuiltins = (sizeof(fmgr_builtins) / sizeof(FmgrBuiltin)) - 1;
+ EOM
+
+ close H;
+ close T;
+
+ # If OK, then rename temp files on top of final files, if
+ # they have changed
+ Catalog::RenameTempFile($output_path . 'fmgroids.h');
+ Catalog::RenameTempFile($output_path . 'fmgrtab.c');
+
+ sub usage
+ {
+ die <<EOM;
+ Usage: perl -I [directory of Catalog.pm] gen_fmgr.pl [path to pg_proc.h]
+
+ gen_fmgr.pl generates fmgroids.h and fmgrtab.c from pg_proc.h
+
+ Report bugs to <pgsql-bugs\@postgresql.org>.
+ EOM
+ }
diff --git a/src/include/Makefile b/src/include/Makefile
index 5eead33..4753a28 100644
*** a/src/include/Makefile
--- b/src/include/Makefile
*************** uninstall:
*** 62,68 ****
clean:
! rm -f utils/fmgroids.h parser/gram.h utils/probes.h
distclean maintainer-clean: clean
rm -f pg_config.h dynloader.h pg_config_os.h stamp-h
--- 62,68 ----
clean:
! rm -f utils/fmgroids.h parser/gram.h utils/probes.h catalog/schemapg.h
distclean maintainer-clean: clean
rm -f pg_config.h dynloader.h pg_config_os.h stamp-h
diff --git a/src/include/catalog/genbki.h b/src/include/catalog/genbki.h
index c399d1f..71b8890 100644
*** a/src/include/catalog/genbki.h
--- b/src/include/catalog/genbki.h
***************
*** 5,11 ****
*
* genbki.h defines CATALOG(), DATA(), BKI_BOOTSTRAP and related macros
* so that the catalog header files can be read by the C compiler.
! * (These same words are recognized by genbki.sh to build the BKI
* bootstrap file from these header files.)
*
*
--- 5,11 ----
*
* genbki.h defines CATALOG(), DATA(), BKI_BOOTSTRAP and related macros
* so that the catalog header files can be read by the C compiler.
! * (These same words are recognized by gen_bki.pl to build the BKI
* bootstrap file from these header files.)
*
*
***************
*** 27,32 ****
--- 27,33 ----
#define BKI_SHARED_RELATION
#define BKI_WITHOUT_OIDS
#define BKI_ROWTYPE_OID(oid)
+ #define BKI_NAILED_IN_CACHE
/* Declarations that provide the initial content of a catalog */
/* In C, these need to expand into some harmless, repeatable declaration */
diff --git a/src/include/catalog/indexing.h b/src/include/catalog/indexing.h
index adec833..8dca8de 100644
*** a/src/include/catalog/indexing.h
--- b/src/include/catalog/indexing.h
*************** extern void CatalogUpdateIndexes(Relatio
*** 37,51 ****
/*
* These macros are just to keep the C compiler from spitting up on the
! * upcoming commands for genbki.sh.
*/
#define DECLARE_INDEX(name,oid,decl) extern int no_such_variable
#define DECLARE_UNIQUE_INDEX(name,oid,decl) extern int no_such_variable
- #define BUILD_INDICES
/*
! * What follows are lines processed by genbki.sh to create the statements
* the bootstrap parser will turn into DefineIndex commands.
*
* The keyword is DECLARE_INDEX or DECLARE_UNIQUE_INDEX. The first two
--- 37,50 ----
/*
* These macros are just to keep the C compiler from spitting up on the
! * upcoming commands for gen_bki.pl.
*/
#define DECLARE_INDEX(name,oid,decl) extern int no_such_variable
#define DECLARE_UNIQUE_INDEX(name,oid,decl) extern int no_such_variable
/*
! * What follows are lines processed by gen_bki.pl to create the statements
* the bootstrap parser will turn into DefineIndex commands.
*
* The keyword is DECLARE_INDEX or DECLARE_UNIQUE_INDEX. The first two
*************** DECLARE_UNIQUE_INDEX(pg_default_acl_oid_
*** 278,284 ****
DECLARE_UNIQUE_INDEX(pg_db_role_setting_databaseid_rol_index, 2965, on pg_db_role_setting using btree(setdatabase oid_ops, setrole oid_ops));
#define DbRoleSettingDatidRolidIndexId 2965
- /* last step of initialization script: build the indexes declared above */
- BUILD_INDICES
-
#endif /* INDEXING_H */
--- 277,280 ----
diff --git a/src/include/catalog/pg_aggregate.h b/src/include/catalog/pg_aggregate.h
index 23d4cf6..d1c6e3d 100644
*** a/src/include/catalog/pg_aggregate.h
--- b/src/include/catalog/pg_aggregate.h
***************
*** 11,17 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 11,17 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_am.h b/src/include/catalog/pg_am.h
index f577e57..3873c3e 100644
*** a/src/include/catalog/pg_am.h
--- b/src/include/catalog/pg_am.h
***************
*** 11,17 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
* XXX do NOT break up DATA() statements into multiple lines!
--- 11,17 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
* XXX do NOT break up DATA() statements into multiple lines!
diff --git a/src/include/catalog/pg_amop.h b/src/include/catalog/pg_amop.h
index 9138bbc..697545d 100644
*** a/src/include/catalog/pg_amop.h
--- b/src/include/catalog/pg_amop.h
***************
*** 32,38 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 32,38 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_amproc.h b/src/include/catalog/pg_amproc.h
index 2bd2fd5..c04ba3f 100644
*** a/src/include/catalog/pg_amproc.h
--- b/src/include/catalog/pg_amproc.h
***************
*** 25,31 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 25,31 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_attrdef.h b/src/include/catalog/pg_attrdef.h
index 0fa58c8..8705acb 100644
*** a/src/include/catalog/pg_attrdef.h
--- b/src/include/catalog/pg_attrdef.h
***************
*** 11,17 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 11,17 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_attribute.h b/src/include/catalog/pg_attribute.h
index da93b3c..3b9a5f2 100644
*** a/src/include/catalog/pg_attribute.h
--- b/src/include/catalog/pg_attribute.h
***************
*** 11,23 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
! * information from the DATA() statements.
! *
! * utils/cache/relcache.c requires hard-coded tuple descriptors
! * for some of the system catalogs. So if the schema for any of
! * these changes, be sure and change the appropriate Schema_xxx
! * macros! -cim 2/5/91
*
*-------------------------------------------------------------------------
*/
--- 11,18 ----
* $PostgreSQL$
*
* NOTES
! * The initial contents of pg_attribute are
! * generated at compile time by gen_bki.pl.
*
*-------------------------------------------------------------------------
*/
***************
*** 37,43 ****
#define AttributeRelationId 1249
#define AttributeRelation_Rowtype_Id 75
! CATALOG(pg_attribute,1249) BKI_BOOTSTRAP BKI_WITHOUT_OIDS BKI_ROWTYPE_OID(75)
{
Oid attrelid; /* OID of relation containing this attribute */
NameData attname; /* name of attribute */
--- 32,38 ----
#define AttributeRelationId 1249
#define AttributeRelation_Rowtype_Id 75
! CATALOG(pg_attribute,1249) BKI_BOOTSTRAP BKI_WITHOUT_OIDS BKI_ROWTYPE_OID(75) BKI_NAILED_IN_CACHE
{
Oid attrelid; /* OID of relation containing this attribute */
NameData attname; /* name of attribute */
*************** typedef FormData_pg_attribute *Form_pg_a
*** 206,518 ****
#define Anum_pg_attribute_attacl 19
- /* ----------------
- * initial contents of pg_attribute
- *
- * NOTE: only "bootstrapped" relations need to be declared here.
- *
- * NOTE: if changing pg_attribute column set, also see the hard-coded
- * entries for system attributes in catalog/heap.c.
- * ----------------
- */
-
- /* ----------------
- * pg_type
- * ----------------
- */
- #define Schema_pg_type \
- { 1247, {"typname"}, 19, -1, 0, NAMEDATALEN, 1, 0, -1, -1, false, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1247, {"typnamespace"}, 26, -1, 0, 4, 2, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1247, {"typowner"}, 26, -1, 0, 4, 3, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1247, {"typlen"}, 21, -1, 0, 2, 4, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, { 0 } }, \
- { 1247, {"typbyval"}, 16, -1, 0, 1, 5, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1247, {"typtype"}, 18, -1, 0, 1, 6, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1247, {"typcategory"}, 18, -1, 0, 1, 7, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1247, {"typispreferred"},16, -1, 0, 1, 8, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1247, {"typisdefined"}, 16, -1, 0, 1, 9, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1247, {"typdelim"}, 18, -1, 0, 1, 10, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1247, {"typrelid"}, 26, -1, 0, 4, 11, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1247, {"typelem"}, 26, -1, 0, 4, 12, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1247, {"typarray"}, 26, -1, 0, 4, 13, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1247, {"typinput"}, 24, -1, 0, 4, 14, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1247, {"typoutput"}, 24, -1, 0, 4, 15, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1247, {"typreceive"}, 24, -1, 0, 4, 16, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1247, {"typsend"}, 24, -1, 0, 4, 17, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1247, {"typmodin"}, 24, -1, 0, 4, 18, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1247, {"typmodout"}, 24, -1, 0, 4, 19, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1247, {"typanalyze"}, 24, -1, 0, 4, 20, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1247, {"typalign"}, 18, -1, 0, 1, 21, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1247, {"typstorage"}, 18, -1, 0, 1, 22, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1247, {"typnotnull"}, 16, -1, 0, 1, 23, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1247, {"typbasetype"}, 26, -1, 0, 4, 24, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1247, {"typtypmod"}, 23, -1, 0, 4, 25, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1247, {"typndims"}, 23, -1, 0, 4, 26, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1247, {"typdefaultbin"}, 25, -1, 0, -1, 27, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
- { 1247, {"typdefault"}, 25, -1, 0, -1, 28, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }
-
- DATA(insert ( 1247 typname 19 -1 0 NAMEDATALEN 1 0 -1 -1 f p c t f f t 0 _null_));
- DATA(insert ( 1247 typnamespace 26 -1 0 4 2 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1247 typowner 26 -1 0 4 3 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1247 typlen 21 -1 0 2 4 0 -1 -1 t p s t f f t 0 _null_));
- DATA(insert ( 1247 typbyval 16 -1 0 1 5 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1247 typtype 18 -1 0 1 6 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1247 typcategory 18 -1 0 1 7 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1247 typispreferred 16 -1 0 1 8 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1247 typisdefined 16 -1 0 1 9 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1247 typdelim 18 -1 0 1 10 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1247 typrelid 26 -1 0 4 11 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1247 typelem 26 -1 0 4 12 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1247 typarray 26 -1 0 4 13 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1247 typinput 24 -1 0 4 14 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1247 typoutput 24 -1 0 4 15 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1247 typreceive 24 -1 0 4 16 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1247 typsend 24 -1 0 4 17 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1247 typmodin 24 -1 0 4 18 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1247 typmodout 24 -1 0 4 19 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1247 typanalyze 24 -1 0 4 20 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1247 typalign 18 -1 0 1 21 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1247 typstorage 18 -1 0 1 22 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1247 typnotnull 16 -1 0 1 23 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1247 typbasetype 26 -1 0 4 24 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1247 typtypmod 23 -1 0 4 25 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1247 typndims 23 -1 0 4 26 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1247 typdefaultbin 25 -1 0 -1 27 0 -1 -1 f x i f f f t 0 _null_));
- DATA(insert ( 1247 typdefault 25 -1 0 -1 28 0 -1 -1 f x i f f f t 0 _null_));
- DATA(insert ( 1247 ctid 27 0 0 6 -1 0 -1 -1 f p s t f f t 0 _null_));
- DATA(insert ( 1247 oid 26 0 0 4 -2 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1247 xmin 28 0 0 4 -3 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1247 cmin 29 0 0 4 -4 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1247 xmax 28 0 0 4 -5 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1247 cmax 29 0 0 4 -6 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1247 tableoid 26 0 0 4 -7 0 -1 -1 t p i t f f t 0 _null_));
-
- /* ----------------
- * pg_proc
- * ----------------
- */
- #define Schema_pg_proc \
- { 1255, {"proname"}, 19, -1, 0, NAMEDATALEN, 1, 0, -1, -1, false, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1255, {"pronamespace"}, 26, -1, 0, 4, 2, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1255, {"proowner"}, 26, -1, 0, 4, 3, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1255, {"prolang"}, 26, -1, 0, 4, 4, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1255, {"procost"}, 700, -1, 0, 4, 5, 0, -1, -1, FLOAT4PASSBYVAL, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1255, {"prorows"}, 700, -1, 0, 4, 6, 0, -1, -1, FLOAT4PASSBYVAL, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1255, {"provariadic"}, 26, -1, 0, 4, 7, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1255, {"proisagg"}, 16, -1, 0, 1, 8, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1255, {"proiswindow"}, 16, -1, 0, 1, 9, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1255, {"prosecdef"}, 16, -1, 0, 1, 10, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1255, {"proisstrict"}, 16, -1, 0, 1, 11, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1255, {"proretset"}, 16, -1, 0, 1, 12, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1255, {"provolatile"}, 18, -1, 0, 1, 13, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1255, {"pronargs"}, 21, -1, 0, 2, 14, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, { 0 } }, \
- { 1255, {"pronargdefaults"}, 21, -1, 0, 2, 15, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, { 0 } }, \
- { 1255, {"prorettype"}, 26, -1, 0, 4, 16, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1255, {"proargtypes"}, 30, -1, 0, -1, 17, 1, -1, -1, false, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1255, {"proallargtypes"}, 1028, -1, 0, -1, 18, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
- { 1255, {"proargmodes"}, 1002, -1, 0, -1, 19, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
- { 1255, {"proargnames"}, 1009, -1, 0, -1, 20, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
- { 1255, {"proargdefaults"}, 25, -1, 0, -1, 21, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
- { 1255, {"prosrc"}, 25, -1, 0, -1, 22, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
- { 1255, {"probin"}, 25, -1, 0, -1, 23, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
- { 1255, {"proconfig"}, 1009, -1, 0, -1, 24, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
- { 1255, {"proacl"}, 1034, -1, 0, -1, 25, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }
-
- DATA(insert ( 1255 proname 19 -1 0 NAMEDATALEN 1 0 -1 -1 f p c t f f t 0 _null_));
- DATA(insert ( 1255 pronamespace 26 -1 0 4 2 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1255 proowner 26 -1 0 4 3 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1255 prolang 26 -1 0 4 4 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1255 procost 700 -1 0 4 5 0 -1 -1 FLOAT4PASSBYVAL p i t f f t 0 _null_));
- DATA(insert ( 1255 prorows 700 -1 0 4 6 0 -1 -1 FLOAT4PASSBYVAL p i t f f t 0 _null_));
- DATA(insert ( 1255 provariadic 26 -1 0 4 7 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1255 proisagg 16 -1 0 1 8 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1255 proiswindow 16 -1 0 1 9 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1255 prosecdef 16 -1 0 1 10 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1255 proisstrict 16 -1 0 1 11 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1255 proretset 16 -1 0 1 12 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1255 provolatile 18 -1 0 1 13 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1255 pronargs 21 -1 0 2 14 0 -1 -1 t p s t f f t 0 _null_));
- DATA(insert ( 1255 pronargdefaults 21 -1 0 2 15 0 -1 -1 t p s t f f t 0 _null_));
- DATA(insert ( 1255 prorettype 26 -1 0 4 16 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1255 proargtypes 30 -1 0 -1 17 1 -1 -1 f p i t f f t 0 _null_));
- DATA(insert ( 1255 proallargtypes 1028 -1 0 -1 18 1 -1 -1 f x i f f f t 0 _null_));
- DATA(insert ( 1255 proargmodes 1002 -1 0 -1 19 1 -1 -1 f x i f f f t 0 _null_));
- DATA(insert ( 1255 proargnames 1009 -1 0 -1 20 1 -1 -1 f x i f f f t 0 _null_));
- DATA(insert ( 1255 proargdefaults 25 -1 0 -1 21 0 -1 -1 f x i f f f t 0 _null_));
- DATA(insert ( 1255 prosrc 25 -1 0 -1 22 0 -1 -1 f x i f f f t 0 _null_));
- DATA(insert ( 1255 probin 25 -1 0 -1 23 0 -1 -1 f x i f f f t 0 _null_));
- DATA(insert ( 1255 proconfig 1009 -1 0 -1 24 1 -1 -1 f x i f f f t 0 _null_));
- DATA(insert ( 1255 proacl 1034 -1 0 -1 25 1 -1 -1 f x i f f f t 0 _null_));
- DATA(insert ( 1255 ctid 27 0 0 6 -1 0 -1 -1 f p s t f f t 0 _null_));
- DATA(insert ( 1255 oid 26 0 0 4 -2 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1255 xmin 28 0 0 4 -3 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1255 cmin 29 0 0 4 -4 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1255 xmax 28 0 0 4 -5 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1255 cmax 29 0 0 4 -6 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1255 tableoid 26 0 0 4 -7 0 -1 -1 t p i t f f t 0 _null_));
-
- /* ----------------
- * pg_attribute
- * ----------------
- */
- #define Schema_pg_attribute \
- { 1249, {"attrelid"}, 26, -1, 0, 4, 1, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1249, {"attname"}, 19, -1, 0, NAMEDATALEN, 2, 0, -1, -1, false, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1249, {"atttypid"}, 26, -1, 0, 4, 3, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1249, {"attstattarget"}, 23, -1, 0, 4, 4, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1249, {"attdistinct"}, 700, -1, 0, 4, 5, 0, -1, -1, FLOAT4PASSBYVAL, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1249, {"attlen"}, 21, -1, 0, 2, 6, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, { 0 } }, \
- { 1249, {"attnum"}, 21, -1, 0, 2, 7, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, { 0 } }, \
- { 1249, {"attndims"}, 23, -1, 0, 4, 8, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1249, {"attcacheoff"}, 23, -1, 0, 4, 9, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1249, {"atttypmod"}, 23, -1, 0, 4, 10, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1249, {"attbyval"}, 16, -1, 0, 1, 11, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1249, {"attstorage"}, 18, -1, 0, 1, 12, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1249, {"attalign"}, 18, -1, 0, 1, 13, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1249, {"attnotnull"}, 16, -1, 0, 1, 14, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1249, {"atthasdef"}, 16, -1, 0, 1, 15, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1249, {"attisdropped"}, 16, -1, 0, 1, 16, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1249, {"attislocal"}, 16, -1, 0, 1, 17, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1249, {"attinhcount"}, 23, -1, 0, 4, 18, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1249, {"attacl"}, 1034, -1, 0, -1, 19, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }
-
- DATA(insert ( 1249 attrelid 26 -1 0 4 1 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1249 attname 19 -1 0 NAMEDATALEN 2 0 -1 -1 f p c t f f t 0 _null_));
- DATA(insert ( 1249 atttypid 26 -1 0 4 3 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1249 attstattarget 23 -1 0 4 4 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1249 attdistinct 700 -1 0 4 5 0 -1 -1 FLOAT4PASSBYVAL p i t f f t 0 _null_));
- DATA(insert ( 1249 attlen 21 -1 0 2 6 0 -1 -1 t p s t f f t 0 _null_));
- DATA(insert ( 1249 attnum 21 -1 0 2 7 0 -1 -1 t p s t f f t 0 _null_));
- DATA(insert ( 1249 attndims 23 -1 0 4 8 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1249 attcacheoff 23 -1 0 4 9 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1249 atttypmod 23 -1 0 4 10 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1249 attbyval 16 -1 0 1 11 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1249 attstorage 18 -1 0 1 12 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1249 attalign 18 -1 0 1 13 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1249 attnotnull 16 -1 0 1 14 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1249 atthasdef 16 -1 0 1 15 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1249 attisdropped 16 -1 0 1 16 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1249 attislocal 16 -1 0 1 17 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1249 attinhcount 23 -1 0 4 18 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1249 attacl 1034 -1 0 -1 19 1 -1 -1 f x i f f f t 0 _null_));
- DATA(insert ( 1249 ctid 27 0 0 6 -1 0 -1 -1 f p s t f f t 0 _null_));
- /* no OIDs in pg_attribute */
- DATA(insert ( 1249 xmin 28 0 0 4 -3 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1249 cmin 29 0 0 4 -4 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1249 xmax 28 0 0 4 -5 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1249 cmax 29 0 0 4 -6 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1249 tableoid 26 0 0 4 -7 0 -1 -1 t p i t f f t 0 _null_));
-
- /* ----------------
- * pg_class
- * ----------------
- */
- #define Schema_pg_class \
- { 1259, {"relname"}, 19, -1, 0, NAMEDATALEN, 1, 0, -1, -1, false, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1259, {"relnamespace"}, 26, -1, 0, 4, 2, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1259, {"reltype"}, 26, -1, 0, 4, 3, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1259, {"relowner"}, 26, -1, 0, 4, 4, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1259, {"relam"}, 26, -1, 0, 4, 5, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1259, {"relfilenode"}, 26, -1, 0, 4, 6, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1259, {"reltablespace"}, 26, -1, 0, 4, 7, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1259, {"relpages"}, 23, -1, 0, 4, 8, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1259, {"reltuples"}, 700, -1, 0, 4, 9, 0, -1, -1, FLOAT4PASSBYVAL, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1259, {"reltoastrelid"}, 26, -1, 0, 4, 10, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1259, {"reltoastidxid"}, 26, -1, 0, 4, 11, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1259, {"relhasindex"}, 16, -1, 0, 1, 12, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1259, {"relisshared"}, 16, -1, 0, 1, 13, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1259, {"relistemp"}, 16, -1, 0, 1, 14, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1259, {"relkind"}, 18, -1, 0, 1, 15, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1259, {"relnatts"}, 21, -1, 0, 2, 16, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, { 0 } }, \
- { 1259, {"relchecks"}, 21, -1, 0, 2, 17, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, { 0 } }, \
- { 1259, {"relhasoids"}, 16, -1, 0, 1, 18, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1259, {"relhaspkey"}, 16, -1, 0, 1, 19, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1259, {"relhasexclusion"},16, -1, 0, 1, 20, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1259, {"relhasrules"}, 16, -1, 0, 1, 21, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1259, {"relhastriggers"},16, -1, 0, 1, 22, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1259, {"relhassubclass"},16, -1, 0, 1, 23, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1259, {"relfrozenxid"}, 28, -1, 0, 4, 24, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1259, {"relacl"}, 1034, -1, 0, -1, 25, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
- { 1259, {"reloptions"}, 1009, -1, 0, -1, 26, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }
-
- DATA(insert ( 1259 relname 19 -1 0 NAMEDATALEN 1 0 -1 -1 f p c t f f t 0 _null_));
- DATA(insert ( 1259 relnamespace 26 -1 0 4 2 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1259 reltype 26 -1 0 4 3 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1259 relowner 26 -1 0 4 4 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1259 relam 26 -1 0 4 5 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1259 relfilenode 26 -1 0 4 6 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1259 reltablespace 26 -1 0 4 7 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1259 relpages 23 -1 0 4 8 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1259 reltuples 700 -1 0 4 9 0 -1 -1 FLOAT4PASSBYVAL p i t f f t 0 _null_));
- DATA(insert ( 1259 reltoastrelid 26 -1 0 4 10 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1259 reltoastidxid 26 -1 0 4 11 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1259 relhasindex 16 -1 0 1 12 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1259 relisshared 16 -1 0 1 13 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1259 relistemp 16 -1 0 1 14 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1259 relkind 18 -1 0 1 15 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1259 relnatts 21 -1 0 2 16 0 -1 -1 t p s t f f t 0 _null_));
- DATA(insert ( 1259 relchecks 21 -1 0 2 17 0 -1 -1 t p s t f f t 0 _null_));
- DATA(insert ( 1259 relhasoids 16 -1 0 1 18 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1259 relhaspkey 16 -1 0 1 19 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1259 relhasexclusion 16 -1 0 1 20 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1259 relhasrules 16 -1 0 1 21 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1259 relhastriggers 16 -1 0 1 22 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1259 relhassubclass 16 -1 0 1 23 0 -1 -1 t p c t f f t 0 _null_));
- DATA(insert ( 1259 relfrozenxid 28 -1 0 4 24 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1259 relacl 1034 -1 0 -1 25 1 -1 -1 f x i f f f t 0 _null_));
- DATA(insert ( 1259 reloptions 1009 -1 0 -1 26 1 -1 -1 f x i f f f t 0 _null_));
- DATA(insert ( 1259 ctid 27 0 0 6 -1 0 -1 -1 f p s t f f t 0 _null_));
- DATA(insert ( 1259 oid 26 0 0 4 -2 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1259 xmin 28 0 0 4 -3 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1259 cmin 29 0 0 4 -4 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1259 xmax 28 0 0 4 -5 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1259 cmax 29 0 0 4 -6 0 -1 -1 t p i t f f t 0 _null_));
- DATA(insert ( 1259 tableoid 26 0 0 4 -7 0 -1 -1 t p i t f f t 0 _null_));
-
- /* ----------------
- * pg_database
- *
- * pg_database is not bootstrapped in the same way as the other relations that
- * have hardwired pg_attribute entries in this file. However, we do need
- * a "Schema_xxx" macro for it --- see relcache.c.
- * ----------------
- */
- #define Schema_pg_database \
- { 1262, {"datname"}, 19, -1, 0, NAMEDATALEN, 1, 0, -1, -1, false, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1262, {"datdba"}, 26, -1, 0, 4, 2, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1262, {"encoding"}, 23, -1, 0, 4, 3, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1262, {"datcollate"}, 19, -1, 0, NAMEDATALEN, 4, 0, -1, -1, false, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1262, {"datctype"}, 19, -1, 0, NAMEDATALEN, 5, 0, -1, -1, false, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1262, {"datistemplate"}, 16, -1, 0, 1, 6, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1262, {"datallowconn"}, 16, -1, 0, 1, 7, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 1262, {"datconnlimit"}, 23, -1, 0, 4, 8, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1262, {"datlastsysoid"}, 26, -1, 0, 4, 9, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1262, {"datfrozenxid"}, 28, -1, 0, 4, 10, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1262, {"dattablespace"}, 26, -1, 0, 4, 11, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 1262, {"datacl"}, 1034, -1, 0, -1, 12, 1, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }
-
- /* ----------------
- * pg_index
- *
- * pg_index is not bootstrapped in the same way as the other relations that
- * have hardwired pg_attribute entries in this file. However, we do need
- * a "Schema_xxx" macro for it --- see relcache.c.
- * ----------------
- */
- #define Schema_pg_index \
- { 0, {"indexrelid"}, 26, -1, 0, 4, 1, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 0, {"indrelid"}, 26, -1, 0, 4, 2, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 0, {"indnatts"}, 21, -1, 0, 2, 3, 0, -1, -1, true, 'p', 's', true, false, false, true, 0, { 0 } }, \
- { 0, {"indisunique"}, 16, -1, 0, 1, 4, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 0, {"indisprimary"}, 16, -1, 0, 1, 5, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 0, {"indimmediate"}, 16, -1, 0, 1, 6, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 0, {"indisclustered"}, 16, -1, 0, 1, 7, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 0, {"indisvalid"}, 16, -1, 0, 1, 8, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 0, {"indcheckxmin"}, 16, -1, 0, 1, 9, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 0, {"indisready"}, 16, -1, 0, 1, 10, 0, -1, -1, true, 'p', 'c', true, false, false, true, 0, { 0 } }, \
- { 0, {"indkey"}, 22, -1, 0, -1, 11, 1, -1, -1, false, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 0, {"indclass"}, 30, -1, 0, -1, 12, 1, -1, -1, false, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 0, {"indoption"}, 22, -1, 0, -1, 13, 1, -1, -1, false, 'p', 'i', true, false, false, true, 0, { 0 } }, \
- { 0, {"indexprs"}, 25, -1, 0, -1, 14, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }, \
- { 0, {"indpred"}, 25, -1, 0, -1, 15, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0, { 0 } }
-
#endif /* PG_ATTRIBUTE_H */
--- 201,204 ----
diff --git a/src/include/catalog/pg_auth_members.h b/src/include/catalog/pg_auth_members.h
index 5d6156d..4fedace 100644
*** a/src/include/catalog/pg_auth_members.h
--- b/src/include/catalog/pg_auth_members.h
***************
*** 11,17 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 11,17 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_authid.h b/src/include/catalog/pg_authid.h
index ad24bba..da6ac17 100644
*** a/src/include/catalog/pg_authid.h
--- b/src/include/catalog/pg_authid.h
***************
*** 13,19 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 13,19 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_cast.h b/src/include/catalog/pg_cast.h
index abf2e93..e789a4e 100644
*** a/src/include/catalog/pg_cast.h
--- b/src/include/catalog/pg_cast.h
***************
*** 13,19 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 13,19 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_class.h b/src/include/catalog/pg_class.h
index dbdee1a..923d6a3 100644
*** a/src/include/catalog/pg_class.h
--- b/src/include/catalog/pg_class.h
***************
*** 11,17 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 11,17 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
***************
*** 29,35 ****
#define RelationRelationId 1259
#define RelationRelation_Rowtype_Id 83
! CATALOG(pg_class,1259) BKI_BOOTSTRAP BKI_ROWTYPE_OID(83)
{
NameData relname; /* class name */
Oid relnamespace; /* OID of namespace containing this class */
--- 29,35 ----
#define RelationRelationId 1259
#define RelationRelation_Rowtype_Id 83
! CATALOG(pg_class,1259) BKI_BOOTSTRAP BKI_ROWTYPE_OID(83) BKI_NAILED_IN_CACHE
{
NameData relname; /* class name */
Oid relnamespace; /* OID of namespace containing this class */
diff --git a/src/include/catalog/pg_constraint.h b/src/include/catalog/pg_constraint.h
index f5912bb..cd2f9a2 100644
*** a/src/include/catalog/pg_constraint.h
--- b/src/include/catalog/pg_constraint.h
***************
*** 11,17 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 11,17 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_conversion.h b/src/include/catalog/pg_conversion.h
index 64e4d6f..7f29017 100644
*** a/src/include/catalog/pg_conversion.h
--- b/src/include/catalog/pg_conversion.h
***************
*** 11,17 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 11,17 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_database.h b/src/include/catalog/pg_database.h
index 9c029b8..61d337a 100644
*** a/src/include/catalog/pg_database.h
--- b/src/include/catalog/pg_database.h
***************
*** 11,17 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 11,17 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
***************
*** 29,35 ****
#define DatabaseRelationId 1262
#define DatabaseRelation_Rowtype_Id 1248
! CATALOG(pg_database,1262) BKI_SHARED_RELATION BKI_ROWTYPE_OID(1248)
{
NameData datname; /* database name */
Oid datdba; /* owner of database */
--- 29,35 ----
#define DatabaseRelationId 1262
#define DatabaseRelation_Rowtype_Id 1248
! CATALOG(pg_database,1262) BKI_SHARED_RELATION BKI_ROWTYPE_OID(1248) BKI_NAILED_IN_CACHE
{
NameData datname; /* database name */
Oid datdba; /* owner of database */
diff --git a/src/include/catalog/pg_db_role_setting.h b/src/include/catalog/pg_db_role_setting.h
index 51526b5..96a7d3a 100644
*** a/src/include/catalog/pg_db_role_setting.h
--- b/src/include/catalog/pg_db_role_setting.h
***************
*** 10,16 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
* XXX do NOT break up DATA() statements into multiple lines!
--- 10,16 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
* XXX do NOT break up DATA() statements into multiple lines!
diff --git a/src/include/catalog/pg_default_acl.h b/src/include/catalog/pg_default_acl.h
index 192face..8a2b378 100644
*** a/src/include/catalog/pg_default_acl.h
--- b/src/include/catalog/pg_default_acl.h
***************
*** 10,16 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 10,16 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_depend.h b/src/include/catalog/pg_depend.h
index 8714d52..18f6494 100644
*** a/src/include/catalog/pg_depend.h
--- b/src/include/catalog/pg_depend.h
***************
*** 11,17 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 11,17 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_description.h b/src/include/catalog/pg_description.h
index a42c635..65fc716 100644
*** a/src/include/catalog/pg_description.h
--- b/src/include/catalog/pg_description.h
***************
*** 25,31 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
* XXX do NOT break up DATA() statements into multiple lines!
--- 25,31 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
* XXX do NOT break up DATA() statements into multiple lines!
*************** typedef FormData_pg_description *Form_pg
*** 78,84 ****
/*
* Because the contents of this table are taken from the other *.h files,
* there is no initialization here. The initial contents are extracted
! * by genbki.sh and loaded during initdb.
*/
#endif /* PG_DESCRIPTION_H */
--- 78,84 ----
/*
* Because the contents of this table are taken from the other *.h files,
* there is no initialization here. The initial contents are extracted
! * by gen_bki.pl and loaded during initdb.
*/
#endif /* PG_DESCRIPTION_H */
diff --git a/src/include/catalog/pg_enum.h b/src/include/catalog/pg_enum.h
index 9761a2e..93cd3c5 100644
*** a/src/include/catalog/pg_enum.h
--- b/src/include/catalog/pg_enum.h
***************
*** 10,16 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
* XXX do NOT break up DATA() statements into multiple lines!
--- 10,16 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
* XXX do NOT break up DATA() statements into multiple lines!
diff --git a/src/include/catalog/pg_foreign_data_wrapper.h b/src/include/catalog/pg_foreign_data_wrapper.h
index 73ff3bd..5ed0551 100644
*** a/src/include/catalog/pg_foreign_data_wrapper.h
--- b/src/include/catalog/pg_foreign_data_wrapper.h
***************
*** 11,17 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 11,17 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_foreign_server.h b/src/include/catalog/pg_foreign_server.h
index fcccf78..e864cc8 100644
*** a/src/include/catalog/pg_foreign_server.h
--- b/src/include/catalog/pg_foreign_server.h
***************
*** 9,15 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 9,15 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_index.h b/src/include/catalog/pg_index.h
index d9bf7e9..e691a59 100644
*** a/src/include/catalog/pg_index.h
--- b/src/include/catalog/pg_index.h
***************
*** 11,17 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 11,17 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
***************
*** 28,34 ****
*/
#define IndexRelationId 2610
! CATALOG(pg_index,2610) BKI_WITHOUT_OIDS
{
Oid indexrelid; /* OID of the index */
Oid indrelid; /* OID of the relation it indexes */
--- 28,34 ----
*/
#define IndexRelationId 2610
! CATALOG(pg_index,2610) BKI_WITHOUT_OIDS BKI_NAILED_IN_CACHE
{
Oid indexrelid; /* OID of the index */
Oid indrelid; /* OID of the relation it indexes */
diff --git a/src/include/catalog/pg_inherits.h b/src/include/catalog/pg_inherits.h
index 43c46da..3f99f0f 100644
*** a/src/include/catalog/pg_inherits.h
--- b/src/include/catalog/pg_inherits.h
***************
*** 11,17 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 11,17 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_language.h b/src/include/catalog/pg_language.h
index dc782f8..c1bc55c 100644
*** a/src/include/catalog/pg_language.h
--- b/src/include/catalog/pg_language.h
***************
*** 11,17 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 11,17 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_largeobject.h b/src/include/catalog/pg_largeobject.h
index 6dd2fb0..b1b3cee 100644
*** a/src/include/catalog/pg_largeobject.h
--- b/src/include/catalog/pg_largeobject.h
***************
*** 11,17 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 11,17 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_largeobject_metadata.h b/src/include/catalog/pg_largeobject_metadata.h
index e0b6c9a..241ee4f 100755
*** a/src/include/catalog/pg_largeobject_metadata.h
--- b/src/include/catalog/pg_largeobject_metadata.h
***************
*** 11,17 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 11,17 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_listener.h b/src/include/catalog/pg_listener.h
index 8693e73..9179d9d 100644
*** a/src/include/catalog/pg_listener.h
--- b/src/include/catalog/pg_listener.h
***************
*** 10,16 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 10,16 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_namespace.h b/src/include/catalog/pg_namespace.h
index 9168079..1683637 100644
*** a/src/include/catalog/pg_namespace.h
--- b/src/include/catalog/pg_namespace.h
***************
*** 11,17 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 11,17 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_opclass.h b/src/include/catalog/pg_opclass.h
index 2e106f9..1b2d2d3 100644
*** a/src/include/catalog/pg_opclass.h
--- b/src/include/catalog/pg_opclass.h
***************
*** 31,37 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 31,37 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_operator.h b/src/include/catalog/pg_operator.h
index eb079dd..0250083 100644
*** a/src/include/catalog/pg_operator.h
--- b/src/include/catalog/pg_operator.h
***************
*** 11,17 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
* XXX do NOT break up DATA() statements into multiple lines!
--- 11,17 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
* XXX do NOT break up DATA() statements into multiple lines!
diff --git a/src/include/catalog/pg_opfamily.h b/src/include/catalog/pg_opfamily.h
index 9be6bed..7cd800a 100644
*** a/src/include/catalog/pg_opfamily.h
--- b/src/include/catalog/pg_opfamily.h
***************
*** 11,17 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 11,17 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_pltemplate.h b/src/include/catalog/pg_pltemplate.h
index cbb0a33..b59dfca 100644
*** a/src/include/catalog/pg_pltemplate.h
--- b/src/include/catalog/pg_pltemplate.h
***************
*** 11,17 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 11,17 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index 8fe9dec..5ca7149 100644
*** a/src/include/catalog/pg_proc.h
--- b/src/include/catalog/pg_proc.h
***************
*** 10,16 ****
* $PostgreSQL$
*
* NOTES
! * The script catalog/genbki.sh reads this file and generates .bki
* information from the DATA() statements. utils/Gen_fmgrtab.sh
* generates fmgroids.h and fmgrtab.c the same way.
*
--- 10,16 ----
* $PostgreSQL$
*
* NOTES
! * The script catalog/gen_bki.pl reads this file and generates .bki
* information from the DATA() statements. utils/Gen_fmgrtab.sh
* generates fmgroids.h and fmgrtab.c the same way.
*
***************
*** 33,39 ****
#define ProcedureRelationId 1255
#define ProcedureRelation_Rowtype_Id 81
! CATALOG(pg_proc,1255) BKI_BOOTSTRAP BKI_ROWTYPE_OID(81)
{
NameData proname; /* procedure name */
Oid pronamespace; /* OID of namespace containing this proc */
--- 33,39 ----
#define ProcedureRelationId 1255
#define ProcedureRelation_Rowtype_Id 81
! CATALOG(pg_proc,1255) BKI_BOOTSTRAP BKI_ROWTYPE_OID(81) BKI_NAILED_IN_CACHE
{
NameData proname; /* procedure name */
Oid pronamespace; /* OID of namespace containing this proc */
diff --git a/src/include/catalog/pg_rewrite.h b/src/include/catalog/pg_rewrite.h
index 4ad9da4..97f0aba 100644
*** a/src/include/catalog/pg_rewrite.h
--- b/src/include/catalog/pg_rewrite.h
***************
*** 14,20 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 14,20 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_shdepend.h b/src/include/catalog/pg_shdepend.h
index bad78be..68bd11a 100644
*** a/src/include/catalog/pg_shdepend.h
--- b/src/include/catalog/pg_shdepend.h
***************
*** 11,17 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 11,17 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_shdescription.h b/src/include/catalog/pg_shdescription.h
index 79c4e97..c6c2511 100644
*** a/src/include/catalog/pg_shdescription.h
--- b/src/include/catalog/pg_shdescription.h
***************
*** 18,24 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
* XXX do NOT break up DATA() statements into multiple lines!
--- 18,24 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
* XXX do NOT break up DATA() statements into multiple lines!
*************** typedef FormData_pg_shdescription *Form_
*** 69,75 ****
/*
* Because the contents of this table are taken from the other *.h files,
* there is no initialization here. The initial contents are extracted
! * by genbki.sh and loaded during initdb.
*/
#endif /* PG_SHDESCRIPTION_H */
--- 69,75 ----
/*
* Because the contents of this table are taken from the other *.h files,
* there is no initialization here. The initial contents are extracted
! * by gen_bki.pl and loaded during initdb.
*/
#endif /* PG_SHDESCRIPTION_H */
diff --git a/src/include/catalog/pg_statistic.h b/src/include/catalog/pg_statistic.h
index e8316a2..348d9d4 100644
*** a/src/include/catalog/pg_statistic.h
--- b/src/include/catalog/pg_statistic.h
***************
*** 11,17 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 11,17 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_tablespace.h b/src/include/catalog/pg_tablespace.h
index 29cd6f4..0a3ab5a 100644
*** a/src/include/catalog/pg_tablespace.h
--- b/src/include/catalog/pg_tablespace.h
***************
*** 11,17 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 11,17 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_trigger.h b/src/include/catalog/pg_trigger.h
index d90eca7..0cd7e12 100644
*** a/src/include/catalog/pg_trigger.h
--- b/src/include/catalog/pg_trigger.h
***************
*** 11,17 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 11,17 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_ts_config.h b/src/include/catalog/pg_ts_config.h
index 730851f..2923df6 100644
*** a/src/include/catalog/pg_ts_config.h
--- b/src/include/catalog/pg_ts_config.h
***************
*** 10,16 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
* XXX do NOT break up DATA() statements into multiple lines!
--- 10,16 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
* XXX do NOT break up DATA() statements into multiple lines!
diff --git a/src/include/catalog/pg_ts_config_map.h b/src/include/catalog/pg_ts_config_map.h
index ee81377..54ddcf8 100644
*** a/src/include/catalog/pg_ts_config_map.h
--- b/src/include/catalog/pg_ts_config_map.h
***************
*** 10,16 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
* XXX do NOT break up DATA() statements into multiple lines!
--- 10,16 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
* XXX do NOT break up DATA() statements into multiple lines!
diff --git a/src/include/catalog/pg_ts_dict.h b/src/include/catalog/pg_ts_dict.h
index 9449fcc..bd6166c 100644
*** a/src/include/catalog/pg_ts_dict.h
--- b/src/include/catalog/pg_ts_dict.h
***************
*** 10,16 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
* XXX do NOT break up DATA() statements into multiple lines!
--- 10,16 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
* XXX do NOT break up DATA() statements into multiple lines!
diff --git a/src/include/catalog/pg_ts_parser.h b/src/include/catalog/pg_ts_parser.h
index 72c0f7c..d66997e 100644
*** a/src/include/catalog/pg_ts_parser.h
--- b/src/include/catalog/pg_ts_parser.h
***************
*** 10,16 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
* XXX do NOT break up DATA() statements into multiple lines!
--- 10,16 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
* XXX do NOT break up DATA() statements into multiple lines!
diff --git a/src/include/catalog/pg_ts_template.h b/src/include/catalog/pg_ts_template.h
index 999a326..def6d18 100644
*** a/src/include/catalog/pg_ts_template.h
--- b/src/include/catalog/pg_ts_template.h
***************
*** 10,16 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
* XXX do NOT break up DATA() statements into multiple lines!
--- 10,16 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
* XXX do NOT break up DATA() statements into multiple lines!
diff --git a/src/include/catalog/pg_type.h b/src/include/catalog/pg_type.h
index b96b298..04b1a5c 100644
*** a/src/include/catalog/pg_type.h
--- b/src/include/catalog/pg_type.h
***************
*** 11,17 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 11,17 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
***************
*** 34,40 ****
#define TypeRelationId 1247
#define TypeRelation_Rowtype_Id 71
! CATALOG(pg_type,1247) BKI_BOOTSTRAP BKI_ROWTYPE_OID(71)
{
NameData typname; /* type name */
Oid typnamespace; /* OID of namespace containing this type */
--- 34,40 ----
#define TypeRelationId 1247
#define TypeRelation_Rowtype_Id 71
! CATALOG(pg_type,1247) BKI_BOOTSTRAP BKI_ROWTYPE_OID(71) BKI_NAILED_IN_CACHE
{
NameData typname; /* type name */
Oid typnamespace; /* OID of namespace containing this type */
*************** typedef FormData_pg_type *Form_pg_type;
*** 264,272 ****
* Keep the following ordered by OID so that later changes can be made more
* easily.
*
! * For types used in the system catalogs, make sure the typlen, typbyval, and
! * typalign values here match the initial values for attlen, attbyval, and
! * attalign in both places in pg_attribute.h for every instance. Also see
* TypInfo[] in bootstrap.c.
*/
--- 264,270 ----
* Keep the following ordered by OID so that later changes can be made more
* easily.
*
! * For types used in the system catalogs, make sure the values here match
* TypInfo[] in bootstrap.c.
*/
diff --git a/src/include/catalog/pg_user_mapping.h b/src/include/catalog/pg_user_mapping.h
index 56d487e..d7a4954 100644
*** a/src/include/catalog/pg_user_mapping.h
--- b/src/include/catalog/pg_user_mapping.h
***************
*** 9,15 ****
* $PostgreSQL$
*
* NOTES
! * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
--- 9,15 ----
* $PostgreSQL$
*
* NOTES
! * the gen_bki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
diff --git a/src/include/catalog/toasting.h b/src/include/catalog/toasting.h
index ea1eda3..b4b4d8b 100644
*** a/src/include/catalog/toasting.h
--- b/src/include/catalog/toasting.h
*************** extern void BootstrapToastTable(char *re
*** 25,37 ****
/*
* This macro is just to keep the C compiler from spitting up on the
! * upcoming commands for genbki.sh.
*/
#define DECLARE_TOAST(name,toastoid,indexoid) extern int no_such_variable
/*
! * What follows are lines processed by genbki.sh to create the statements
* the bootstrap parser will turn into BootstrapToastTable commands.
* Each line specifies the system catalog that needs a toast table,
* the OID to assign to the toast table, and the OID to assign to the
--- 25,37 ----
/*
* This macro is just to keep the C compiler from spitting up on the
! * upcoming commands for gen_bki.pl.
*/
#define DECLARE_TOAST(name,toastoid,indexoid) extern int no_such_variable
/*
! * What follows are lines processed by gen_bki.pl to create the statements
* the bootstrap parser will turn into BootstrapToastTable commands.
* Each line specifies the system catalog that needs a toast table,
* the OID to assign to the toast table, and the OID to assign to the
diff --git a/src/tools/msvc/Genbki.pm b/src/tools/msvc/Genbki.pm
index da46197..e69de29 100644
*** a/src/tools/msvc/Genbki.pm
--- b/src/tools/msvc/Genbki.pm
***************
*** 1,262 ****
- #!/usr/bin/perl
- #-------------------------------------------------------------------------
- #
- # Genbki.pm --
- # perl script which generates .bki files from specially formatted .h
- # files. These .bki files are used to initialize the postgres template
- # database.
- #
- # Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
- # Portions Copyright (c) 1994, Regents of the University of California
- #
- #
- # IDENTIFICATION
- # $PostgreSQL$
- #
- #-------------------------------------------------------------------------
-
- package Genbki;
-
- use strict;
- use warnings;
-
- use Exporter;
- our (@ISA, @EXPORT_OK);
- @ISA = qw(Exporter);
- @EXPORT_OK = qw(genbki);
-
- sub genbki
- {
- my $version = shift;
- my $prefix = shift;
-
- $version =~ /^(\d+\.\d+)/ || die "Bad format version $version\n";
- my $majorversion = $1;
-
- my $pgauthid = read_file("src/include/catalog/pg_authid.h");
- $pgauthid =~ /^#define\s+BOOTSTRAP_SUPERUSERID\s+(\d+)$/mg
- || die "Could not read BOOTSTRAP_SUPERUSERID from pg_authid.h\n";
- my $bootstrapsuperuserid = $1;
-
- my $pgnamespace = read_file("src/include/catalog/pg_namespace.h");
- $pgnamespace =~ /^#define\s+PG_CATALOG_NAMESPACE\s+(\d+)$/mg
- || die "Could not read PG_CATALOG_NAMESPACE from pg_namespace.h\n";
- my $pgcatalognamespace = $1;
-
- my $indata = "";
-
- while (@_)
- {
- my $f = shift;
- next unless $f;
- $indata .= read_file($f);
- $indata .= "\n";
- }
-
- # Strip C comments, from perl FAQ 4.27
- $indata =~ s{/\*.*?\*/}{}gs;
-
- $indata =~ s{;\s*$}{}gm;
- $indata =~ s{^\s+}{}gm;
- $indata =~ s{^Oid}{oid}gm;
- $indata =~ s{\(Oid}{(oid}gm;
- $indata =~ s{^NameData}{name}gm;
- $indata =~ s{\(NameData}{(name}g;
- $indata =~ s{^TransactionId}{xid}gm;
- $indata =~ s{\(TransactionId}{(xid}g;
- $indata =~ s{PGUID}{$bootstrapsuperuserid}g;
- $indata =~ s{PGNSP}{$pgcatalognamespace}g;
-
- #print $indata;
-
- my $bki = "";
- my $desc = "";
- my $shdesc = "";
-
- my $oid = 0;
- my $catalog = 0;
- my $reln_open = 0;
- my $bootstrap = "";
- my $shared_relation = "";
- my $without_oids = "";
- my $rowtype_oid = "";
- my $nc = 0;
- my $inside = 0;
- my @attr;
- my @types;
-
- foreach my $line (split /\n/, $indata)
- {
- if ($line =~ /^DATA\((.*)\)$/m)
- {
- my $data = $1;
- my @fields = split /\s+/,$data;
- if ($#fields >=4 && $fields[0] eq "insert" && $fields[1] eq "OID" && $fields[2] eq "=")
- {
- $oid = $fields[3];
- }
- else
- {
- $oid = 0;
- }
- $data =~ s/\s+/ /g;
- $bki .= $data . "\n";
- }
- elsif ($line =~ /^DESCR\("(.*)"\)$/m)
- {
- if ($oid != 0)
- {
- $desc .= sprintf("%d\t%s\t0\t%s\n", $oid, $catalog, $1);
- }
- }
- elsif ($line =~ /^SHDESCR\("(.*)"\)$/m)
- {
- if ($oid != 0)
- {
- $shdesc .= sprintf("%d\t%s\t%s\n", $oid, $catalog, $1);
- }
- }
- elsif ($line =~ /^DECLARE_(UNIQUE_)?INDEX\((.*)\)$/m)
- {
- if ($reln_open)
- {
- $bki .= "close $catalog\n";
- $reln_open = 0;
- }
- my $u = $1?" unique":"";
- my @fields = split /,/,$2,3;
- $fields[0] =~ s/\s+//g;
- $fields[1] =~ s/\s+//g;
- $fields[2] =~ s/\s+/ /g;
- $fields[2] =~ s/^\s+//;
- $bki .= "declare$u index $fields[0] $fields[1] $fields[2]\n";
- }
- elsif ($line =~ /^DECLARE_TOAST\((.*)\)$/m)
- {
- if ($reln_open)
- {
- $bki .= "close $catalog\n";
- $reln_open = 0;
- }
- my @fields = split /,/,$1;
- $fields[1] =~ s/\s+//g;
- $fields[2] =~ s/\s+//g;
- $bki .= "declare toast $fields[1] $fields[2] on $fields[0]\n";
- }
- elsif ($line =~ /^BUILD_INDICES/)
- {
- $bki .= "build indices\n";
- }
- elsif ($line =~ /^CATALOG\(([^)]*)\)(.*)$/m)
- {
- if ($reln_open)
- {
- $bki .= "close $catalog\n";
- $reln_open = 0;
- }
- my $rest = $2;
- my @fields = split /,/,$1;
- $catalog = $fields[0];
- $oid = $fields[1];
- $bootstrap=$shared_relation=$without_oids=$rowtype_oid="";
- if ($rest =~ /BKI_BOOTSTRAP/)
- {
- $bootstrap = " bootstrap";
- }
- if ($rest =~ /BKI_SHARED_RELATION/)
- {
- $shared_relation = " shared_relation";
- }
- if ($rest =~ /BKI_WITHOUT_OIDS/)
- {
- $without_oids = " without_oids";
- }
- if ($rest =~ /BKI_ROWTYPE_OID\((\d+)\)/)
- {
- $rowtype_oid = " rowtype_oid $1";
- }
- $nc++;
- $inside = 1;
- next;
- }
- if ($inside==1)
- {
- next if ($line =~ /{/);
- if ($line =~ /}/)
- {
-
- # Last line
- $bki .= "create $catalog $oid$bootstrap$shared_relation$without_oids$rowtype_oid\n (\n";
- my $first = 1;
- for (my $i = 0; $i <= $#attr; $i++)
- {
- if ($first == 1)
- {
- $first = 0;
- }
- else
- {
- $bki .= " ,\n";
- }
- $bki .= " " . $attr[$i] . " = " . $types[$i];
- }
- $bki .= "\n )\n";
- undef(@attr);
- undef(@types);
- $reln_open = 1;
- $inside = 0;
- if ($bootstrap eq "")
- {
- $bki .= "open $catalog\n";
- }
- next;
- }
-
- # inside catalog definition, so keep sucking up attributes
- my @fields = split /\s+/,$line;
- if ($fields[1] =~ /(.*)\[.*\]/)
- { #Array attribute
- push @attr, $1;
- push @types, $fields[0] . '[]';
- }
- else
- {
- push @attr, $fields[1];
- push @types, $fields[0];
- }
- next;
- }
- }
- if ($reln_open == 1)
- {
- $bki .= "close $catalog\n";
- }
-
- open(O,">$prefix.bki") || die "Could not write $prefix.bki\n";
- print O "# PostgreSQL $majorversion\n";
- print O $bki;
- close(O);
- open(O,">$prefix.description") || die "Could not write $prefix.description\n";
- print O $desc;
- close(O);
- open(O,">$prefix.shdescription") || die "Could not write $prefix.shdescription\n";
- print O $shdesc;
- close(O);
- }
-
- sub read_file
- {
- my $filename = shift;
- my $F;
- my $t = $/;
-
- undef $/;
- open($F, $filename) || die "Could not open file $filename\n";
- my $txt = <$F>;
- close($F);
- $/ = $t;
-
- return $txt;
- }
-
- 1;
--- 0 ----
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index d2621cb..b4a566d 100644
*** a/src/tools/msvc/Solution.pm
--- b/src/tools/msvc/Solution.pm
*************** use Carp;
*** 9,16 ****
use strict;
use warnings;
- use Genbki;
-
sub new
{
my $junk = shift;
--- 9,14 ----
*************** s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x)
*** 204,210 ****
{
print "Generating fmgrtab.c and fmgroids.h...\n";
chdir('src\backend\utils');
! system("perl Gen_fmgrtab.pl ../../../src/include/catalog/pg_proc.h");
chdir('..\..\..');
copyFile('src\backend\utils\fmgroids.h','src\include\utils\fmgroids.h');
}
--- 202,210 ----
{
print "Generating fmgrtab.c and fmgroids.h...\n";
chdir('src\backend\utils');
!
! # We need to pass the location of Catalog.pm to the Perl interpreter
! system("perl -I ../catalog gen_fmgr.pl ../../../src/include/catalog/pg_proc.h");
chdir('..\..\..');
copyFile('src\backend\utils\fmgroids.h','src\include\utils\fmgroids.h');
}
*************** EOF
*** 293,299 ****
close(O);
}
! my $mf = Project::read_file('src\backend\catalog\Makefile');
$mf =~ s{\\s*[\r\n]+}{}mg;
$mf =~ /^POSTGRES_BKI_SRCS\s*:?=[^,]+,(.*)\)$/gm
|| croak "Could not find POSTGRES_BKI_SRCS in Makefile\n";
--- 293,299 ----
close(O);
}
! my $mf = Project::read_file('src\Makefile.global.in');
$mf =~ s{\\s*[\r\n]+}{}mg;
$mf =~ /^POSTGRES_BKI_SRCS\s*:?=[^,]+,(.*)\)$/gm
|| croak "Could not find POSTGRES_BKI_SRCS in Makefile\n";
*************** EOF
*** 303,314 ****
next if $bki eq "";
if (IsNewer('src/backend/catalog/postgres.bki', "src/include/catalog/$bki"))
{
! print "Generating postgres.bki...\n";
! Genbki::genbki(
! $self->{majorver},
! "src/backend/catalog/postgres",
! split(/ /,join(' src/include/catalog/',@allbki))
! );
last;
}
}
--- 303,314 ----
next if $bki eq "";
if (IsNewer('src/backend/catalog/postgres.bki', "src/include/catalog/$bki"))
{
! print "Generating BKI files and schemapg.h...\n";
! chdir('src\backend\catalog');
! my @bki_srcs = split(/ /, join(' src/include/catalog/', @allbki));
! system("perl gen_bki.pl -I../../../src/include --set-version=$self->{majorver} @bki_srcs");
! chdir('..\..\..');
! copyFile('src\backend\catalog\schemapg.h','src\include\catalog\schemapg.h');
last;
}
}
On Sun, Dec 20, 2009 at 7:20 PM, John Naylor <jcnaylor@gmail.com> wrote:
Greetings,
Following up on my experimental patch last month to revamp the BKI
infrastructure, I am proposing a less invasive set of changes with the
hope of offering something committable. Some of these were discussed
by Robert Haas and others last summer.1. Remove all DATA() declarations from pg_attribute.h, since they are
easily generated. Introduce a new BKI pseudo-command
BKI_NAILED_IN_CACHE, which indicates that relcache.c needs a
Schema_pg_foo declaration for that catalog. Place these declarations
in a new header schemapg.h. This will reduce the effort to add or
change critical tables.2. Use identical scripts on Posix and Windows systems, using Perl 5.6
(no CPAN modules needed). The grepping of the catalog headers is done
by Catalog.pm, which gives the scripts gen_bki.pl and gen_fmgr.pl a
structured interface to the data. The pg_type info is saved so that
the relevant fields can be copied into those of pg_attribute.3. Make the BKI files, fmgrtab.c, fmgroids.h, and schemapg.h distprep
targets, so distribution tarballs can still be built without Perl on
Posix systems.Feedback on the Makefile changes would be appreciated, since that was
the hardest part for me. The MSVC changes are untested.
This is really nice. I haven't done a full review, but it seems as if
you've eliminated some of the more controversial aspects of what I did
before, as well as done some good cleanup and refactoring. One minor
nit is that I think we should end up with genbki.pl rather than
gen_bki.pl, in the interest of changing nothing without a good reason.
A more important point is whether we really need to make this
dependent on Perl 5.6 or later. What features are we using here that
actually require Perl 5.6? I suspect the answer is "none, but we
don't like writing the code in a way that is backward compatible to
crufty, ancient versions of Perl", to which my response is "get over
it". :-) I always use the three-argument form of open() in all new
code, but for fixed strings the two-argument form is just as good and
has been supported for far longer. Any suggestions that we should
prefer clean code over portability are, in my opinion, non-starters.
Again, thank you for your work on this!
...Robert
Hi,
On Monday 21 December 2009 02:23:39 Robert Haas wrote:
A more important point is whether we really need to make this
dependent on Perl 5.6 or later. What features are we using here that
actually require Perl 5.6? I suspect the answer is "none, but we
don't like writing the code in a way that is backward compatible to
crufty, ancient versions of Perl", to which my response is "get over
it". :-) I always use the three-argument form of open() in all new
code, but for fixed strings the two-argument form is just as good and
has been supported for far longer. Any suggestions that we should
prefer clean code over portability are, in my opinion, non-starters.
I dont see a platform without perl 5.6 where a new enough flex/bison is
available...
Andres
Andres Freund <andres@anarazel.de> writes:
On Monday 21 December 2009 02:23:39 Robert Haas wrote:
A more important point is whether we really need to make this
dependent on Perl 5.6 or later.
I dont see a platform without perl 5.6 where a new enough flex/bison is
available...
That argument only holds water if you are willing to follow the same
rules as we use for flex/bison, ie, they are not needed to build from
a source tarball. Otherwise this *is* moving the goalposts on required
tool support.
regards, tom lane
On Monday 21 December 2009 04:23:57 Tom Lane wrote:
Andres Freund <andres@anarazel.de> writes:
On Monday 21 December 2009 02:23:39 Robert Haas wrote:
A more important point is whether we really need to make this
dependent on Perl 5.6 or later.I dont see a platform without perl 5.6 where a new enough flex/bison is
available...That argument only holds water if you are willing to follow the same
rules as we use for flex/bison, ie, they are not needed to build from
a source tarball. Otherwise this *is* moving the goalposts on required
tool support.
The patch already does that if I understood John correctly.
Andres
On Sun, Dec 20, 2009 at 7:24 PM, Andres Freund <andres@anarazel.de> wrote:
On Monday 21 December 2009 04:23:57 Tom Lane wrote:
Andres Freund <andres@anarazel.de> writes:
On Monday 21 December 2009 02:23:39 Robert Haas wrote:
A more important point is whether we really need to make this
dependent on Perl 5.6 or later.I dont see a platform without perl 5.6 where a new enough flex/bison is
available...That argument only holds water if you are willing to follow the same
rules as we use for flex/bison, ie, they are not needed to build from
a source tarball. Otherwise this *is* moving the goalposts on required
tool support.The patch already does that if I understood John correctly.
Yes, everything output by Perl in my patch is a distprep target.
Some minor changes would enable it to work on 5.0, but I'd like to
make sure that's necessary.
So, what Perl version should be targeted for those building from CVS,
and is that already documented somewhere? Does anyone know the
earliest version on the build farm?
John
On Sun, Dec 20, 2009 at 10:23 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Andres Freund <andres@anarazel.de> writes:
On Monday 21 December 2009 02:23:39 Robert Haas wrote:
A more important point is whether we really need to make this
dependent on Perl 5.6 or later.I dont see a platform without perl 5.6 where a new enough flex/bison is
available...That argument only holds water if you are willing to follow the same
rules as we use for flex/bison, ie, they are not needed to build from
a source tarball. Otherwise this *is* moving the goalposts on required
tool support.
I believe that we have long had agreement on making the relevant files
distprep targets, so this will not be an issue. Anyway, the whole
thing is a silly argument anyway: we can certainly make this
compatible back even as far as Perl 5.0 if need be for very little
extra work.
What is worth a little bit of effort to establish is exactly what
version of Perl we're already depending on, so that we can document
that for the benefit of future tool writers. There's no reason why
this particular thing needs to be compatible further back than what is
already required otherwise.
...Robert
On Sun, Dec 20, 2009 at 10:55:55PM -0500, Robert Haas wrote:
On Sun, Dec 20, 2009 at 10:23 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Andres Freund <andres@anarazel.de> writes:
On Monday 21 December 2009 02:23:39 Robert Haas wrote:
A more important point is whether we really need to make this
dependent on Perl 5.6 or later.I dont see a platform without perl 5.6 where a new enough flex/bison is
available...That argument only holds water if you are willing to follow the same
rules as we use for flex/bison, ie, they are not needed to build from
a source tarball. �Otherwise this *is* moving the goalposts on required
tool support.I believe that we have long had agreement on making the relevant files
distprep targets, so this will not be an issue. Anyway, the whole
thing is a silly argument anyway: we can certainly make this
compatible back even as far as Perl 5.0 if need be for very little
extra work.
FYI Perl 5.6.0 was released in March 2000. 5.6.2 in November 2003.
The general perception in the perl community is that 5.8.x is the oldest
perl that's widely used and that gets regular automated testing:
http://stats.cpantesters.org/pmatrix-wide.html
There's very little use of 5.6.x (typically 5.6.2).
There's almost no use of earlier versions.
What is worth a little bit of effort to establish is exactly what
version of Perl we're already depending on, so that we can document
that for the benefit of future tool writers. There's no reason why
this particular thing needs to be compatible further back than what is
already required otherwise.
I'd like to know the earliest version of perl that's supported for
PL/Perl, if that's ever been determined (I've not seen it in the docs).
plperl requires Safe v2.09, released in Oct 2003 and included in 5.8.1.
That version, and later versions, have only been tested back to perl 5.6.
I'd recommend Perl 5.6(.2) as a minimum for threads/multiplicity.
Perl 5.5 had complelely different, and unsafe, code for threads
and no concept of multiplicity.
I'd recommend Perl 5.8(.1) as a minimum for UTF-8 databases.
Perl 5.7 had a complelely different, and flawed, concept of
Unicode operation.
Tim.
p.s. I'll test PL/Perl with perl 5.6.2 (assuming I can still build it on
my system) as part of testing the PL/Perl patches I'm working on.
On Mon, Dec 21, 2009 at 5:45 AM, Tim Bunce <Tim.Bunce@pobox.com> wrote:
FYI Perl 5.6.0 was released in March 2000. 5.6.2 in November 2003.
Gosh, I feel old. I started on Perl 4.036.
What is worth a little bit of effort to establish is exactly what
version of Perl we're already depending on, so that we can document
that for the benefit of future tool writers. There's no reason why
this particular thing needs to be compatible further back than what is
already required otherwise.I'd like to know the earliest version of perl that's supported for
PL/Perl, if that's ever been determined (I've not seen it in the docs).plperl requires Safe v2.09, released in Oct 2003 and included in 5.8.1.
That version, and later versions, have only been tested back to perl 5.6.I'd recommend Perl 5.6(.2) as a minimum for threads/multiplicity.
Perl 5.5 had complelely different, and unsafe, code for threads
and no concept of multiplicity.I'd recommend Perl 5.8(.1) as a minimum for UTF-8 databases.
Perl 5.7 had a complelely different, and flawed, concept of
Unicode operation.Tim.
p.s. I'll test PL/Perl with perl 5.6.2 (assuming I can still build it on
my system) as part of testing the PL/Perl patches I'm working on.
It's possible that we might support building the release in general
with an older version of Perl than what we support for PL/perl, but it
sounds like we may have already burned this bridge if the MSVC stuff
expects something newer. Maybe we should just document that 5.6 is
the minimum supported version to build from source and be done with it
(we should clarify what MSVC requires). If someone is running a 1990s
version of Perl in 2010 when 8.5 comes out, they can always make
distprep on another machine. There can't be many people who will want
a brand-new PostgreSQL and an ancient Perl, I think.
...Robert
2009/12/21 Robert Haas <robertmhaas@gmail.com>:
On Mon, Dec 21, 2009 at 5:45 AM, Tim Bunce <Tim.Bunce@pobox.com> wrote:
FYI Perl 5.6.0 was released in March 2000. 5.6.2 in November 2003.
Gosh, I feel old. I started on Perl 4.036.
What is worth a little bit of effort to establish is exactly what
version of Perl we're already depending on, so that we can document
that for the benefit of future tool writers. There's no reason why
this particular thing needs to be compatible further back than what is
already required otherwise.I'd like to know the earliest version of perl that's supported for
PL/Perl, if that's ever been determined (I've not seen it in the docs).plperl requires Safe v2.09, released in Oct 2003 and included in 5.8.1.
That version, and later versions, have only been tested back to perl 5.6.I'd recommend Perl 5.6(.2) as a minimum for threads/multiplicity.
Perl 5.5 had complelely different, and unsafe, code for threads
and no concept of multiplicity.I'd recommend Perl 5.8(.1) as a minimum for UTF-8 databases.
Perl 5.7 had a complelely different, and flawed, concept of
Unicode operation.Tim.
p.s. I'll test PL/Perl with perl 5.6.2 (assuming I can still build it on
my system) as part of testing the PL/Perl patches I'm working on.It's possible that we might support building the release in general
with an older version of Perl than what we support for PL/perl, but it
sounds like we may have already burned this bridge if the MSVC stuff
expects something newer. Maybe we should just document that 5.6 is
The MSVC stuff is only tested on 5.8.
the minimum supported version to build from source and be done with it
(we should clarify what MSVC requires). If someone is running a 1990s
You mean somehting like
http://www.postgresql.org/docs/8.4/static/install-win32-full.html#AEN23266
--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/
On Dec 21, 2009, at 7:46 AM, Magnus Hagander <magnus@hagander.net>
wrote:
2009/12/21 Robert Haas <robertmhaas@gmail.com>:
On Mon, Dec 21, 2009 at 5:45 AM, Tim Bunce <Tim.Bunce@pobox.com>
wrote:FYI Perl 5.6.0 was released in March 2000. 5.6.2 in November 2003.
Gosh, I feel old. I started on Perl 4.036.
What is worth a little bit of effort to establish is exactly what
version of Perl we're already depending on, so that we can document
that for the benefit of future tool writers. There's no reason why
this particular thing needs to be compatible further back than
what is
already required otherwise.I'd like to know the earliest version of perl that's supported for
PL/Perl, if that's ever been determined (I've not seen it in the
docs).plperl requires Safe v2.09, released in Oct 2003 and included in
5.8.1.
That version, and later versions, have only been tested back to
perl 5.6.I'd recommend Perl 5.6(.2) as a minimum for threads/multiplicity.
Perl 5.5 had complelely different, and unsafe, code for threads
and no concept of multiplicity.I'd recommend Perl 5.8(.1) as a minimum for UTF-8 databases.
Perl 5.7 had a complelely different, and flawed, concept of
Unicode operation.Tim.
p.s. I'll test PL/Perl with perl 5.6.2 (assuming I can still build
it on
my system) as part of testing the PL/Perl patches I'm working on.It's possible that we might support building the release in general
with an older version of Perl than what we support for PL/perl, but
it
sounds like we may have already burned this bridge if the MSVC stuff
expects something newer. Maybe we should just document that 5.6 isThe MSVC stuff is only tested on 5.8.
the minimum supported version to build from source and be done with
it
(we should clarify what MSVC requires). If someone is running a
1990sYou mean somehting like
http://www.postgresql.org/docs/8.4/static/install-win32-full.html#AEN23266
Yeah, very much like that. :-)
...Robert
Magnus Hagander <magnus@hagander.net> writes:
2009/12/21 Robert Haas <robertmhaas@gmail.com>:
On Mon, Dec 21, 2009 at 5:45 AM, Tim Bunce <Tim.Bunce@pobox.com> wrote:
plperl requires Safe v2.09, released in Oct 2003 and included in 5.8.1.
That version, and later versions, have only been tested back to perl 5.6.
I'd recommend Perl 5.8(.1) as a minimum for UTF-8 databases.
Perl 5.7 had a complelely different, and flawed, concept of
Unicode operation.
The MSVC stuff is only tested on 5.8.
Given the above three things it seems like we could define 5.8.1 as the
minimum required version.
regards, tom lane
On Mon, Dec 21, 2009 at 10:09:58AM -0500, Tom Lane wrote:
Magnus Hagander <magnus@hagander.net> writes:
2009/12/21 Robert Haas <robertmhaas@gmail.com>:
On Mon, Dec 21, 2009 at 5:45 AM, Tim Bunce <Tim.Bunce@pobox.com> wrote:
plperl requires Safe v2.09, released in Oct 2003 and included in 5.8.1.
That version, and later versions, have only been tested back to perl 5.6.I'd recommend Perl 5.8(.1) as a minimum for UTF-8 databases.
Perl 5.7 had a complelely different, and flawed, concept of
Unicode operation.The MSVC stuff is only tested on 5.8.
Given the above three things it seems like we could define 5.8.1 as the
minimum required version.
I'd be delighted with that.
Tim.
On Dec 21, 2009, at 7:18 AM, Tim Bunce wrote:
Given the above three things it seems like we could define 5.8.1 as the
minimum required version.I'd be delighted with that.
+1
BTW Tim, have you tested with 5.11 yet?
Best,
David
On Mon, Dec 21, 2009 at 08:22:54AM -0800, David E. Wheeler wrote:
On Dec 21, 2009, at 7:18 AM, Tim Bunce wrote:
Given the above three things it seems like we could define 5.8.1 as the
minimum required version.I'd be delighted with that.
+1
BTW Tim, have you tested with 5.11 yet?
Not recently. I'm putting the finishing touches on my updated feature
patch now. I hope to post it in the next few days. I'll test with 5.8.1
and 5.11 before I do.
Tim.