the catalog has, as well as some other basic properties such as its OID.
Other critical files defining the catalog structure
include <filename>indexing.h</filename>, which defines the indexes present
- on all the system catalogs, and <filename>toasting.h</filename>, which
- defines TOAST tables for catalogs that need one.
+ on all the system catalogs.
</para>
<para>
GENERATED_HEADERS := $(CATALOG_HEADERS:%.h=%_d.h) schemapg.h
-# In the list of headers used to assemble postgres.bki, indexing.h needs
-# be last, and toasting.h just before it. This ensures we don't try to
-# create indexes or toast tables before their catalogs exist.
POSTGRES_BKI_SRCS := $(addprefix $(top_srcdir)/src/include/catalog/,\
- $(CATALOG_HEADERS) toasting.h indexing.h \
+ $(CATALOG_HEADERS) indexing.h \
)
# The .dat files we need can just be listed alphabetically.
#include "catalog/pg_subscription.h"
#include "catalog/pg_tablespace.h"
#include "catalog/pg_type.h"
-#include "catalog/toasting.h"
#include "miscadmin.h"
#include "storage/fd.h"
#include "utils/fmgroids.h"
relationId == SubscriptionObjectIndexId ||
relationId == SubscriptionNameIndexId)
return true;
- /* These are their toast tables and toast indexes (see toasting.h) */
+ /* These are their toast tables and toast indexes */
if (relationId == PgAuthidToastTable ||
relationId == PgAuthidToastIndex ||
relationId == PgDatabaseToastTable ||
/*
* Ignore attempts to create toast tables on catalog tables after initdb.
* Which catalogs get toast tables is explicitly chosen in
- * catalog/toasting.h. (We could get here via some ALTER TABLE command if
+ * catalog/pg_*.h. (We could get here via some ALTER TABLE command if
* the catalog doesn't have a toast table.)
*/
if (IsCatalogRelation(rel) && !IsBootstrapProcessingMode())
use lib "$FindBin::RealBin/../../backend/catalog/";
use Catalog;
-my @input_files = (glob("pg_*.h"), qw(indexing.h toasting.h));
+my @input_files = (glob("pg_*.h"), qw(indexing.h));
my $oids = Catalog::FindAllOidsFromHeaders(@input_files);
*/
#define BKI_LOOKUP(catalog)
+/*
+ * These lines are processed by genbki.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
+ * toast table's index. The reason we hard-wire these OIDs is that we
+ * need stable OIDs for shared relations, and that includes toast tables
+ * of shared relations.
+ *
+ * The macro definition is just to keep the C compiler from spitting up.
+ */
+#define DECLARE_TOAST(name,toastoid,indexoid) extern int no_such_variable
+
/* The following are never defined; they are here only for documentation. */
/*
*/
typedef FormData_pg_aggregate *Form_pg_aggregate;
+DECLARE_TOAST(pg_aggregate, 4159, 4160);
+
#ifdef EXPOSE_TO_CLIENT_CODE
/*
*/
typedef FormData_pg_attrdef *Form_pg_attrdef;
+DECLARE_TOAST(pg_attrdef, 2830, 2831);
+
#endif /* PG_ATTRDEF_H */
*/
typedef FormData_pg_authid *Form_pg_authid;
+DECLARE_TOAST(pg_authid, 4175, 4176);
+#define PgAuthidToastTable 4175
+#define PgAuthidToastIndex 4176
+
#endif /* PG_AUTHID_H */
*/
typedef FormData_pg_constraint *Form_pg_constraint;
+DECLARE_TOAST(pg_constraint, 2832, 2833);
+
#ifdef EXPOSE_TO_CLIENT_CODE
/* Valid values for contype */
*/
typedef FormData_pg_database *Form_pg_database;
+DECLARE_TOAST(pg_database, 4177, 4178);
+#define PgDatabaseToastTable 4177
+#define PgDatabaseToastIndex 4178
+
#endif /* PG_DATABASE_H */
typedef FormData_pg_db_role_setting * Form_pg_db_role_setting;
+DECLARE_TOAST(pg_db_role_setting, 2966, 2967);
+#define PgDbRoleSettingToastTable 2966
+#define PgDbRoleSettingToastIndex 2967
+
/*
* prototypes for functions in pg_db_role_setting.h
*/
*/
typedef FormData_pg_default_acl *Form_pg_default_acl;
+DECLARE_TOAST(pg_default_acl, 4143, 4144);
+
#ifdef EXPOSE_TO_CLIENT_CODE
/*
*/
typedef FormData_pg_depend *Form_pg_depend;
+DECLARE_TOAST(pg_depend, 8888, 8889);
+
#endif /* PG_DEPEND_H */
*/
typedef FormData_pg_description * Form_pg_description;
+DECLARE_TOAST(pg_description, 2834, 2835);
+
#endif /* PG_DESCRIPTION_H */
*/
typedef FormData_pg_event_trigger *Form_pg_event_trigger;
+DECLARE_TOAST(pg_event_trigger, 4145, 4146);
+
#endif /* PG_EVENT_TRIGGER_H */
*/
typedef FormData_pg_extension *Form_pg_extension;
+DECLARE_TOAST(pg_extension, 4147, 4148);
+
#endif /* PG_EXTENSION_H */
*/
typedef FormData_pg_foreign_data_wrapper *Form_pg_foreign_data_wrapper;
+DECLARE_TOAST(pg_foreign_data_wrapper, 4149, 4150);
+
#endif /* PG_FOREIGN_DATA_WRAPPER_H */
*/
typedef FormData_pg_foreign_server *Form_pg_foreign_server;
+DECLARE_TOAST(pg_foreign_server, 4151, 4152);
+
#endif /* PG_FOREIGN_SERVER_H */
*/
typedef FormData_pg_foreign_table *Form_pg_foreign_table;
+DECLARE_TOAST(pg_foreign_table, 4153, 4154);
+
#endif /* PG_FOREIGN_TABLE_H */
*/
typedef FormData_pg_init_privs * Form_pg_init_privs;
+DECLARE_TOAST(pg_init_privs, 4155, 4156);
+
/*
* It is important to know if the initial privileges are from initdb or from an
* extension. This enum is used to provide that differentiation and the two
*/
typedef FormData_pg_language *Form_pg_language;
+DECLARE_TOAST(pg_language, 4157, 4158);
+
#endif /* PG_LANGUAGE_H */
*/
typedef FormData_pg_namespace *Form_pg_namespace;
+DECLARE_TOAST(pg_namespace, 4163, 4164);
+
/*
* prototypes for functions in pg_namespace.c
*/
*/
typedef FormData_pg_partitioned_table *Form_pg_partitioned_table;
+DECLARE_TOAST(pg_partitioned_table, 4165, 4166);
+
#endif /* PG_PARTITIONED_TABLE_H */
*/
typedef FormData_pg_policy *Form_pg_policy;
+DECLARE_TOAST(pg_policy, 4167, 4168);
+
#endif /* PG_POLICY_H */
*/
typedef FormData_pg_proc *Form_pg_proc;
+DECLARE_TOAST(pg_proc, 2836, 2837);
+
#ifdef EXPOSE_TO_CLIENT_CODE
/*
typedef FormData_pg_replication_origin *Form_pg_replication_origin;
+DECLARE_TOAST(pg_replication_origin, 4181, 4182);
+#define PgReplicationOriginToastTable 4181
+#define PgReplicationOriginToastIndex 4182
+
#endif /* PG_REPLICATION_ORIGIN_H */
*/
typedef FormData_pg_rewrite *Form_pg_rewrite;
+DECLARE_TOAST(pg_rewrite, 2838, 2839);
+
#endif /* PG_REWRITE_H */
#endif
} FormData_pg_seclabel;
+DECLARE_TOAST(pg_seclabel, 3598, 3599);
+
#endif /* PG_SECLABEL_H */
*/
typedef FormData_pg_shdescription * Form_pg_shdescription;
+DECLARE_TOAST(pg_shdescription, 2846, 2847);
+#define PgShdescriptionToastTable 2846
+#define PgShdescriptionToastIndex 2847
+
#endif /* PG_SHDESCRIPTION_H */
typedef FormData_pg_shseclabel * Form_pg_shseclabel;
+DECLARE_TOAST(pg_shseclabel, 4060, 4061);
+#define PgShseclabelToastTable 4060
+#define PgShseclabelToastIndex 4061
+
#endif /* PG_SHSECLABEL_H */
*/
typedef FormData_pg_statistic *Form_pg_statistic;
+DECLARE_TOAST(pg_statistic, 2840, 2841);
+
#ifdef EXPOSE_TO_CLIENT_CODE
/*
*/
typedef FormData_pg_statistic_ext *Form_pg_statistic_ext;
+DECLARE_TOAST(pg_statistic_ext, 3439, 3440);
+
#ifdef EXPOSE_TO_CLIENT_CODE
#define STATS_EXT_NDISTINCT 'd'
*/
typedef FormData_pg_statistic_ext_data * Form_pg_statistic_ext_data;
+DECLARE_TOAST(pg_statistic_ext_data, 3430, 3431);
+
#endif /* PG_STATISTIC_EXT_DATA_H */
typedef FormData_pg_subscription *Form_pg_subscription;
+DECLARE_TOAST(pg_subscription, 4183, 4184);
+#define PgSubscriptionToastTable 4183
+#define PgSubscriptionToastIndex 4184
+
typedef struct Subscription
{
Oid oid; /* Oid of the subscription */
*/
typedef FormData_pg_tablespace *Form_pg_tablespace;
+DECLARE_TOAST(pg_tablespace, 4185, 4186);
+#define PgTablespaceToastTable 4185
+#define PgTablespaceToastIndex 4186
+
#endif /* PG_TABLESPACE_H */
*/
typedef FormData_pg_trigger *Form_pg_trigger;
+DECLARE_TOAST(pg_trigger, 2336, 2337);
+
#ifdef EXPOSE_TO_CLIENT_CODE
/* Bits within tgtype */
typedef FormData_pg_ts_dict *Form_pg_ts_dict;
+DECLARE_TOAST(pg_ts_dict, 4169, 4170);
+
#endif /* PG_TS_DICT_H */
*/
typedef FormData_pg_type *Form_pg_type;
+DECLARE_TOAST(pg_type, 4171, 4172);
+
#ifdef EXPOSE_TO_CLIENT_CODE
/*
*/
typedef FormData_pg_user_mapping *Form_pg_user_mapping;
+DECLARE_TOAST(pg_user_mapping, 4173, 4174);
+
#endif /* PG_USER_MAPPING_H */
}
# Collect all the existing assigned OIDs (including those to be remapped).
-my @header_files = (glob("pg_*.h"), qw(indexing.h toasting.h));
+my @header_files = (glob("pg_*.h"), qw(indexing.h));
my $oids = Catalog::FindAllOidsFromHeaders(@header_files);
# Hash-ify the existing OIDs for convenient lookup.
}
}
- # In indexing.h and toasting.h only, check for #define SYM nnnn,
+ # In indexing.h only, check for #define SYM nnnn,
# and replace if within mapped range.
elsif ($line =~ m/^(\s*#\s*define\s+\w+\s+)(\d+)\b/)
{
* toasting.h
* This file provides some definitions to support creation of toast tables
*
- * Caution: all #define's with numeric values in this file had better be
- * object OIDs, else renumber_oids.pl might change them inappropriately.
- *
*
* Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
extern void BootstrapToastTable(char *relName,
Oid toastOid, Oid toastIndexOid);
-
-/*
- * This macro is just to keep the C compiler from spitting up on the
- * upcoming commands for Catalog.pm.
- */
-#define DECLARE_TOAST(name,toastoid,indexoid) extern int no_such_variable
-
-
-/*
- * What follows are lines processed by genbki.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
- * toast table's index. The reason we hard-wire these OIDs is that we
- * need stable OIDs for shared relations, and that includes toast tables
- * of shared relations.
- */
-
-/* normal catalogs */
-DECLARE_TOAST(pg_aggregate, 4159, 4160);
-DECLARE_TOAST(pg_attrdef, 2830, 2831);
-DECLARE_TOAST(pg_constraint, 2832, 2833);
-DECLARE_TOAST(pg_default_acl, 4143, 4144);
-DECLARE_TOAST(pg_depend, 8888, 8889);
-DECLARE_TOAST(pg_description, 2834, 2835);
-DECLARE_TOAST(pg_event_trigger, 4145, 4146);
-DECLARE_TOAST(pg_extension, 4147, 4148);
-DECLARE_TOAST(pg_foreign_data_wrapper, 4149, 4150);
-DECLARE_TOAST(pg_foreign_server, 4151, 4152);
-DECLARE_TOAST(pg_foreign_table, 4153, 4154);
-DECLARE_TOAST(pg_init_privs, 4155, 4156);
-DECLARE_TOAST(pg_language, 4157, 4158);
-DECLARE_TOAST(pg_namespace, 4163, 4164);
-DECLARE_TOAST(pg_partitioned_table, 4165, 4166);
-DECLARE_TOAST(pg_policy, 4167, 4168);
-DECLARE_TOAST(pg_proc, 2836, 2837);
-DECLARE_TOAST(pg_rewrite, 2838, 2839);
-DECLARE_TOAST(pg_seclabel, 3598, 3599);
-DECLARE_TOAST(pg_statistic, 2840, 2841);
-DECLARE_TOAST(pg_statistic_ext, 3439, 3440);
-DECLARE_TOAST(pg_statistic_ext_data, 3430, 3431);
-DECLARE_TOAST(pg_trigger, 2336, 2337);
-DECLARE_TOAST(pg_ts_dict, 4169, 4170);
-DECLARE_TOAST(pg_type, 4171, 4172);
-DECLARE_TOAST(pg_user_mapping, 4173, 4174);
-
-/* shared catalogs */
-DECLARE_TOAST(pg_authid, 4175, 4176);
-#define PgAuthidToastTable 4175
-#define PgAuthidToastIndex 4176
-DECLARE_TOAST(pg_database, 4177, 4178);
-#define PgDatabaseToastTable 4177
-#define PgDatabaseToastIndex 4178
-DECLARE_TOAST(pg_db_role_setting, 2966, 2967);
-#define PgDbRoleSettingToastTable 2966
-#define PgDbRoleSettingToastIndex 2967
-DECLARE_TOAST(pg_replication_origin, 4181, 4182);
-#define PgReplicationOriginToastTable 4181
-#define PgReplicationOriginToastIndex 4182
-DECLARE_TOAST(pg_shdescription, 2846, 2847);
-#define PgShdescriptionToastTable 2846
-#define PgShdescriptionToastIndex 2847
-DECLARE_TOAST(pg_shseclabel, 4060, 4061);
-#define PgShseclabelToastTable 4060
-#define PgShseclabelToastIndex 4061
-DECLARE_TOAST(pg_subscription, 4183, 4184);
-#define PgSubscriptionToastTable 4183
-#define PgSubscriptionToastIndex 4184
-DECLARE_TOAST(pg_tablespace, 4185, 4186);
-#define PgTablespaceToastTable 4185
-#define PgTablespaceToastIndex 4186
-
#endif /* TOASTING_H */
use lib "$FindBin::RealBin/../../backend/catalog/";
use Catalog;
-my @input_files = (glob("pg_*.h"), qw(indexing.h toasting.h));
+my @input_files = (glob("pg_*.h"), qw(indexing.h));
my $oids = Catalog::FindAllOidsFromHeaders(@input_files);
$mf =~ /^CATALOG_HEADERS\s*:?=(.*)$/gm
|| croak "Could not find CATALOG_HEADERS in Makefile\n";
my @bki_srcs = split /\s+/, $1;
- push @bki_srcs, 'toasting.h';
push @bki_srcs, 'indexing.h';
$mf =~ /^POSTGRES_BKI_DATA\s*:?=[^,]+,(.*)\)$/gm
|| croak "Could not find POSTGRES_BKI_DATA in Makefile\n";