diff options
author | Tom Lane | 2001-06-12 05:55:50 +0000 |
---|---|---|
committer | Tom Lane | 2001-06-12 05:55:50 +0000 |
commit | 1d584f97b9bfe1501f9d2bc5528e7818fa73c235 (patch) | |
tree | 59a1a520e2a31718257ca9fa58f7819c8b321ac8 /src/include | |
parent | d2c8358188cc6710e80800827cbb555600fd4b4d (diff) |
Clean up various to-do items associated with system indexes:
pg_database now has unique indexes on oid and on datname.
pg_shadow now has unique indexes on usename and on usesysid.
pg_am now has unique index on oid.
pg_opclass now has unique index on oid.
pg_amproc now has unique index on amid+amopclaid+amprocnum.
Remove pg_rewrite's unnecessary index on oid, delete unused RULEOID syscache.
Remove index on pg_listener and associated syscache for performance reasons
(caching rows that are certain to change before you need 'em again is
rather pointless).
Change pg_attrdef's nonunique index on adrelid into a unique index on
adrelid+adnum.
Fix various incorrect settings of pg_class.relisshared, make that the
primary reference point for whether a relation is shared or not.
IsSharedSystemRelationName() is now only consulted to initialize relisshared
during initial creation of tables and indexes. In theory we might now
support shared user relations, though it's not clear how one would get
entries for them into pg_class &etc of multiple databases.
Fix recently reported bug that pg_attribute rows created for an index all have
the same OID. (Proof that non-unique OID doesn't matter unless it's
actually used to do lookups ;-))
There's no need to treat pg_trigger, pg_attrdef, pg_relcheck as bootstrap
relations. Convert them into plain system catalogs without hardwired
entries in pg_class and friends.
Unify global.bki and template1.bki into a single init script postgres.bki,
since the alleged distinction between them was misleading and pointless.
Not to mention that it didn't work for setting up indexes on shared
system relations.
Rationalize locking of pg_shadow, pg_group, pg_attrdef (no need to use
AccessExclusiveLock where ExclusiveLock or even RowExclusiveLock will do).
Also, hold locks until transaction commit where necessary.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/access/heapam.h | 4 | ||||
-rw-r--r-- | src/include/catalog/catversion.h | 4 | ||||
-rw-r--r-- | src/include/catalog/indexing.h | 61 | ||||
-rw-r--r-- | src/include/catalog/pg_attrdef.h | 2 | ||||
-rw-r--r-- | src/include/catalog/pg_attribute.h | 62 | ||||
-rw-r--r-- | src/include/catalog/pg_class.h | 19 | ||||
-rw-r--r-- | src/include/catalog/pg_listener.h | 9 | ||||
-rw-r--r-- | src/include/catalog/pg_relcheck.h | 2 | ||||
-rw-r--r-- | src/include/catalog/pg_trigger.h | 2 | ||||
-rw-r--r-- | src/include/catalog/pg_type.h | 6 | ||||
-rw-r--r-- | src/include/postgres.h | 16 | ||||
-rw-r--r-- | src/include/utils/syscache.h | 28 |
12 files changed, 78 insertions, 137 deletions
diff --git a/src/include/access/heapam.h b/src/include/access/heapam.h index 4c499151b3..9e2d1d427b 100644 --- a/src/include/access/heapam.h +++ b/src/include/access/heapam.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: heapam.h,v 1.63 2001/03/22 04:00:27 momjian Exp $ + * $Id: heapam.h,v 1.64 2001/06/12 05:55:50 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -234,7 +234,7 @@ extern HeapTuple heap_formtuple(TupleDesc tupleDescriptor, extern HeapTuple heap_modifytuple(HeapTuple tuple, Relation relation, Datum *replValue, char *replNull, char *repl); extern void heap_freetuple(HeapTuple tuple); -HeapTuple heap_addheader(uint32 natts, int structlen, char *structure); +extern HeapTuple heap_addheader(int natts, Size structlen, void *structure); /* in common/heap/stats.c */ extern void PrintHeapAccessStatistics(HeapAccessStatistics stats); diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index c38f27c955..6fcd0f1c1c 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -37,7 +37,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: catversion.h,v 1.81 2001/05/22 16:37:16 petere Exp $ + * $Id: catversion.h,v 1.82 2001/06/12 05:55:50 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -53,6 +53,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 200105221 +#define CATALOG_VERSION_NO 200106111 #endif diff --git a/src/include/catalog/indexing.h b/src/include/catalog/indexing.h index cc155cf1bb..496ba4eaa3 100644 --- a/src/include/catalog/indexing.h +++ b/src/include/catalog/indexing.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: indexing.h,v 1.49 2001/05/07 00:43:24 tgl Exp $ + * $Id: indexing.h,v 1.50 2001/06/12 05:55:50 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -21,23 +21,24 @@ * Number of indices that exist for each system catalog */ #define Num_pg_aggregate_indices 1 -#define Num_pg_am_indices 1 +#define Num_pg_am_indices 2 #define Num_pg_amop_indices 2 +#define Num_pg_amproc_indices 1 #define Num_pg_attr_indices 2 #define Num_pg_attrdef_indices 1 #define Num_pg_class_indices 2 +#define Num_pg_database_indices 2 #define Num_pg_description_indices 1 #define Num_pg_group_indices 2 #define Num_pg_index_indices 2 #define Num_pg_inherits_indices 1 #define Num_pg_language_indices 2 #define Num_pg_largeobject_indices 1 -#define Num_pg_listener_indices 1 -#define Num_pg_opclass_indices 2 +#define Num_pg_opclass_indices 3 #define Num_pg_operator_indices 2 #define Num_pg_proc_indices 2 #define Num_pg_relcheck_indices 1 -#define Num_pg_rewrite_indices 2 +#define Num_pg_rewrite_indices 1 #define Num_pg_shadow_indices 2 #define Num_pg_statistic_indices 1 #define Num_pg_trigger_indices 3 @@ -48,13 +49,17 @@ */ #define AccessMethodOpidIndex "pg_amop_opid_index" #define AccessMethodStrategyIndex "pg_amop_strategy_index" +#define AccessProcedureIndex "pg_amproc_am_opcl_procnum_index" #define AggregateNameTypeIndex "pg_aggregate_name_type_index" #define AmNameIndex "pg_am_name_index" -#define AttrDefaultIndex "pg_attrdef_adrelid_index" +#define AmOidIndex "pg_am_oid_index" +#define AttrDefaultIndex "pg_attrdef_adrelid_adnum_index" #define AttributeRelidNameIndex "pg_attribute_relid_attnam_index" #define AttributeRelidNumIndex "pg_attribute_relid_attnum_index" #define ClassNameIndex "pg_class_relname_index" #define ClassOidIndex "pg_class_oid_index" +#define DatabaseNameIndex "pg_database_datname_index" +#define DatabaseOidIndex "pg_database_oid_index" #define DescriptionObjIndex "pg_description_objoid_index" #define GroupNameIndex "pg_group_name_index" #define GroupSysidIndex "pg_group_sysid_index" @@ -64,18 +69,17 @@ #define LanguageNameIndex "pg_language_name_index" #define LanguageOidIndex "pg_language_oid_index" #define LargeObjectLOidPNIndex "pg_largeobject_loid_pn_index" -#define ListenerPidRelnameIndex "pg_listener_pid_relname_index" #define OpclassDeftypeIndex "pg_opclass_deftype_index" #define OpclassNameIndex "pg_opclass_name_index" +#define OpclassOidIndex "pg_opclass_oid_index" #define OperatorNameIndex "pg_operator_oprname_l_r_k_index" #define OperatorOidIndex "pg_operator_oid_index" #define ProcedureNameIndex "pg_proc_proname_narg_type_index" #define ProcedureOidIndex "pg_proc_oid_index" #define RelCheckIndex "pg_relcheck_rcrelid_index" -#define RewriteOidIndex "pg_rewrite_oid_index" #define RewriteRulenameIndex "pg_rewrite_rulename_index" -#define ShadowNameIndex "pg_shadow_name_index" -#define ShadowSysidIndex "pg_shadow_sysid_index" +#define ShadowNameIndex "pg_shadow_usename_index" +#define ShadowSysidIndex "pg_shadow_usesysid_index" #define StatisticRelidAttnumIndex "pg_statistic_relid_att_index" #define TriggerConstrNameIndex "pg_trigger_tgconstrname_index" #define TriggerConstrRelidIndex "pg_trigger_tgconstrrelid_index" @@ -83,19 +87,21 @@ #define TypeNameIndex "pg_type_typname_index" #define TypeOidIndex "pg_type_oid_index" +/* Arrays of names of indices for each system catalog */ extern char *Name_pg_aggregate_indices[]; extern char *Name_pg_am_indices[]; extern char *Name_pg_amop_indices[]; +extern char *Name_pg_amproc_indices[]; extern char *Name_pg_attr_indices[]; extern char *Name_pg_attrdef_indices[]; extern char *Name_pg_class_indices[]; +extern char *Name_pg_database_indices[]; extern char *Name_pg_description_indices[]; extern char *Name_pg_group_indices[]; extern char *Name_pg_index_indices[]; extern char *Name_pg_inherits_indices[]; extern char *Name_pg_language_indices[]; extern char *Name_pg_largeobject_indices[]; -extern char *Name_pg_listener_indices[]; extern char *Name_pg_opclass_indices[]; extern char *Name_pg_operator_indices[]; extern char *Name_pg_proc_indices[]; @@ -107,8 +113,6 @@ extern char *Name_pg_trigger_indices[]; extern char *Name_pg_type_indices[]; -extern char *IndexedCatalogNames[]; - /* * indexing.c prototypes */ @@ -128,23 +132,35 @@ extern HeapTuple ClassOidIndexScan(Relation heapRelation, Datum relId); /* + * These macros are just to keep the C compiler from spitting up on the + * upcoming commands for genbki.sh. + */ +#define DECLARE_INDEX(x) extern int errno +#define DECLARE_UNIQUE_INDEX(x) extern int errno +#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 every thing after that is just like in a - * normal specification of the 'define index' POSTQUEL command. + * The keyword is DECLARE_INDEX or DECLARE_UNIQUE_INDEX. Everything after + * that is just like in a normal 'create index' SQL command. */ DECLARE_UNIQUE_INDEX(pg_aggregate_name_type_index on pg_aggregate using btree(aggname name_ops, aggbasetype oid_ops)); DECLARE_UNIQUE_INDEX(pg_am_name_index on pg_am using btree(amname name_ops)); +DECLARE_UNIQUE_INDEX(pg_am_oid_index on pg_am using btree(oid oid_ops)); DECLARE_UNIQUE_INDEX(pg_amop_opid_index on pg_amop using btree(amopclaid oid_ops, amopopr oid_ops, amopid oid_ops)); DECLARE_UNIQUE_INDEX(pg_amop_strategy_index on pg_amop using btree(amopid oid_ops, amopclaid oid_ops, amopstrategy int2_ops)); -/* This following index is not used for a cache and is not unique */ -DECLARE_INDEX(pg_attrdef_adrelid_index on pg_attrdef using btree(adrelid oid_ops)); +DECLARE_UNIQUE_INDEX(pg_amproc_am_opcl_procnum_index on pg_amproc using btree(amid oid_ops, amopclaid oid_ops, amprocnum int2_ops)); +DECLARE_UNIQUE_INDEX(pg_attrdef_adrelid_adnum_index on pg_attrdef using btree(adrelid oid_ops, adnum int2_ops)); DECLARE_UNIQUE_INDEX(pg_attribute_relid_attnam_index on pg_attribute using btree(attrelid oid_ops, attname name_ops)); DECLARE_UNIQUE_INDEX(pg_attribute_relid_attnum_index on pg_attribute using btree(attrelid oid_ops, attnum int2_ops)); DECLARE_UNIQUE_INDEX(pg_class_oid_index on pg_class using btree(oid oid_ops)); DECLARE_UNIQUE_INDEX(pg_class_relname_index on pg_class using btree(relname name_ops)); +DECLARE_UNIQUE_INDEX(pg_database_datname_index on pg_database using btree(datname name_ops)); +DECLARE_UNIQUE_INDEX(pg_database_oid_index on pg_database using btree(oid oid_ops)); DECLARE_UNIQUE_INDEX(pg_description_objoid_index on pg_description using btree(objoid oid_ops)); DECLARE_UNIQUE_INDEX(pg_group_name_index on pg_group using btree(groname name_ops)); DECLARE_UNIQUE_INDEX(pg_group_sysid_index on pg_group using btree(grosysid int4_ops)); @@ -155,22 +171,19 @@ DECLARE_UNIQUE_INDEX(pg_inherits_relid_seqno_index on pg_inherits using btree(in DECLARE_UNIQUE_INDEX(pg_language_name_index on pg_language using btree(lanname name_ops)); DECLARE_UNIQUE_INDEX(pg_language_oid_index on pg_language using btree(oid oid_ops)); DECLARE_UNIQUE_INDEX(pg_largeobject_loid_pn_index on pg_largeobject using btree(loid oid_ops, pageno int4_ops)); -DECLARE_UNIQUE_INDEX(pg_listener_pid_relname_index on pg_listener using btree(listenerpid int4_ops, relname name_ops)); /* This column needs to allow multiple zero entries, but is in the cache */ DECLARE_INDEX(pg_opclass_deftype_index on pg_opclass using btree(opcdeftype oid_ops)); DECLARE_UNIQUE_INDEX(pg_opclass_name_index on pg_opclass using btree(opcname name_ops)); +DECLARE_UNIQUE_INDEX(pg_opclass_oid_index on pg_opclass using btree(oid oid_ops)); DECLARE_UNIQUE_INDEX(pg_operator_oid_index on pg_operator using btree(oid oid_ops)); DECLARE_UNIQUE_INDEX(pg_operator_oprname_l_r_k_index on pg_operator using btree(oprname name_ops, oprleft oid_ops, oprright oid_ops, oprkind char_ops)); DECLARE_UNIQUE_INDEX(pg_proc_oid_index on pg_proc using btree(oid oid_ops)); DECLARE_UNIQUE_INDEX(pg_proc_proname_narg_type_index on pg_proc using btree(proname name_ops, pronargs int2_ops, proargtypes oidvector_ops)); /* This following index is not used for a cache and is not unique */ DECLARE_INDEX(pg_relcheck_rcrelid_index on pg_relcheck using btree(rcrelid oid_ops)); -DECLARE_UNIQUE_INDEX(pg_rewrite_oid_index on pg_rewrite using btree(oid oid_ops)); DECLARE_UNIQUE_INDEX(pg_rewrite_rulename_index on pg_rewrite using btree(rulename name_ops)); -/* -xDECLARE_UNIQUE_INDEX(pg_shadow_name_index on pg_shadow using btree(usename name_ops)); -xDECLARE_UNIQUE_INDEX(pg_shadow_sysid_index on pg_shadow using btree(usesysid int4_ops)); -*/ +DECLARE_UNIQUE_INDEX(pg_shadow_usename_index on pg_shadow using btree(usename name_ops)); +DECLARE_UNIQUE_INDEX(pg_shadow_usesysid_index on pg_shadow using btree(usesysid int4_ops)); DECLARE_UNIQUE_INDEX(pg_statistic_relid_att_index on pg_statistic using btree(starelid oid_ops, staattnum int2_ops)); DECLARE_INDEX(pg_trigger_tgconstrname_index on pg_trigger using btree(tgconstrname name_ops)); DECLARE_INDEX(pg_trigger_tgconstrrelid_index on pg_trigger using btree(tgconstrrelid oid_ops)); @@ -178,7 +191,7 @@ DECLARE_INDEX(pg_trigger_tgrelid_index on pg_trigger using btree(tgrelid oid_ops DECLARE_UNIQUE_INDEX(pg_type_oid_index on pg_type using btree(oid oid_ops)); DECLARE_UNIQUE_INDEX(pg_type_typname_index on pg_type using btree(typname name_ops)); -/* now build indices in the initialization scripts */ +/* last step of initialization script: build the indices declared above */ BUILD_INDICES #endif /* INDEXING_H */ diff --git a/src/include/catalog/pg_attrdef.h b/src/include/catalog/pg_attrdef.h index 35c9c2c07b..713776375c 100644 --- a/src/include/catalog/pg_attrdef.h +++ b/src/include/catalog/pg_attrdef.h @@ -27,7 +27,7 @@ * typedef struct FormData_pg_attrdef * ---------------- */ -CATALOG(pg_attrdef) BOOTSTRAP +CATALOG(pg_attrdef) { Oid adrelid; int2 adnum; diff --git a/src/include/catalog/pg_attribute.h b/src/include/catalog/pg_attribute.h index c74dc33f74..95bd2569f4 100644 --- a/src/include/catalog/pg_attribute.h +++ b/src/include/catalog/pg_attribute.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pg_attribute.h,v 1.72 2001/05/14 21:58:10 momjian Exp $ + * $Id: pg_attribute.h,v 1.73 2001/06/12 05:55:50 tgl Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -213,6 +213,8 @@ typedef FormData_pg_attribute *Form_pg_attribute; /* ---------------- * initial contents of pg_attribute + * + * NOTE: only "bootstrapped" relations need to be declared here. * ---------------- */ @@ -470,64 +472,6 @@ DATA(insert OID = 0 ( 1259 cmax 29 0 4 -6 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1259 tableoid 26 0 4 -7 0 -1 -1 t p f i f f)); /* ---------------- - * pg_attrdef - * ---------------- - */ -DATA(insert OID = 0 ( 1215 adrelid 26 0 4 1 0 -1 -1 t p f i f f)); -DATA(insert OID = 0 ( 1215 adnum 21 0 2 2 0 -1 -1 t p f s f f)); -DATA(insert OID = 0 ( 1215 adbin 25 0 -1 3 0 -1 -1 f x f i f f)); -DATA(insert OID = 0 ( 1215 adsrc 25 0 -1 4 0 -1 -1 f x f i f f)); -DATA(insert OID = 0 ( 1215 ctid 27 0 6 -1 0 -1 -1 f p f i f f)); -DATA(insert OID = 0 ( 1215 oid 26 0 4 -2 0 -1 -1 t p f i f f)); -DATA(insert OID = 0 ( 1215 xmin 28 0 4 -3 0 -1 -1 t p f i f f)); -DATA(insert OID = 0 ( 1215 cmin 29 0 4 -4 0 -1 -1 t p f i f f)); -DATA(insert OID = 0 ( 1215 xmax 28 0 4 -5 0 -1 -1 t p f i f f)); -DATA(insert OID = 0 ( 1215 cmax 29 0 4 -6 0 -1 -1 t p f i f f)); -DATA(insert OID = 0 ( 1215 tableoid 26 0 4 -7 0 -1 -1 t p f i f f)); - -/* ---------------- - * pg_relcheck - * ---------------- - */ -DATA(insert OID = 0 ( 1216 rcrelid 26 0 4 1 0 -1 -1 t p f i f f)); -DATA(insert OID = 0 ( 1216 rcname 19 0 NAMEDATALEN 2 0 -1 -1 f p f i f f)); -DATA(insert OID = 0 ( 1216 rcbin 25 0 -1 3 0 -1 -1 f x f i f f)); -DATA(insert OID = 0 ( 1216 rcsrc 25 0 -1 4 0 -1 -1 f x f i f f)); -DATA(insert OID = 0 ( 1216 ctid 27 0 6 -1 0 -1 -1 f p f i f f)); -DATA(insert OID = 0 ( 1216 oid 26 0 4 -2 0 -1 -1 t p f i f f)); -DATA(insert OID = 0 ( 1216 xmin 28 0 4 -3 0 -1 -1 t p f i f f)); -DATA(insert OID = 0 ( 1216 cmin 29 0 4 -4 0 -1 -1 t p f i f f)); -DATA(insert OID = 0 ( 1216 xmax 28 0 4 -5 0 -1 -1 t p f i f f)); -DATA(insert OID = 0 ( 1216 cmax 29 0 4 -6 0 -1 -1 t p f i f f)); -DATA(insert OID = 0 ( 1216 tableoid 26 0 4 -7 0 -1 -1 t p f i f f)); - -/* ---------------- - * pg_trigger - * ---------------- - */ -DATA(insert OID = 0 ( 1219 tgrelid 26 0 4 1 0 -1 -1 t p f i f f)); -DATA(insert OID = 0 ( 1219 tgname 19 0 NAMEDATALEN 2 0 -1 -1 f p f i f f)); -DATA(insert OID = 0 ( 1219 tgfoid 26 0 4 3 0 -1 -1 t p f i f f)); -DATA(insert OID = 0 ( 1219 tgtype 21 0 2 4 0 -1 -1 t p f s f f)); -DATA(insert OID = 0 ( 1219 tgenabled 16 0 1 5 0 -1 -1 t p f c f f)); -DATA(insert OID = 0 ( 1219 tgisconstraint 16 0 1 6 0 -1 -1 t p f c f f)); -DATA(insert OID = 0 ( 1219 tgconstrname 19 0 NAMEDATALEN 7 0 -1 -1 f p f i f f)); -DATA(insert OID = 0 ( 1219 tgconstrrelid 26 0 4 8 0 -1 -1 t p f i f f)); - -DATA(insert OID = 0 ( 1219 tgdeferrable 16 0 1 9 0 -1 -1 t p f c f f)); -DATA(insert OID = 0 ( 1219 tginitdeferred 16 0 1 10 0 -1 -1 t p f c f f)); -DATA(insert OID = 0 ( 1219 tgnargs 21 0 2 11 0 -1 -1 t p f s f f)); -DATA(insert OID = 0 ( 1219 tgattr 22 0 INDEX_MAX_KEYS*2 12 0 -1 -1 f p f i f f)); -DATA(insert OID = 0 ( 1219 tgargs 17 0 -1 13 0 -1 -1 f x f i f f)); -DATA(insert OID = 0 ( 1219 ctid 27 0 6 -1 0 -1 -1 f p f i f f)); -DATA(insert OID = 0 ( 1219 oid 26 0 4 -2 0 -1 -1 t p f i f f)); -DATA(insert OID = 0 ( 1219 xmin 28 0 4 -3 0 -1 -1 t p f i f f)); -DATA(insert OID = 0 ( 1219 cmin 29 0 4 -4 0 -1 -1 t p f i f f)); -DATA(insert OID = 0 ( 1219 xmax 28 0 4 -5 0 -1 -1 t p f i f f)); -DATA(insert OID = 0 ( 1219 cmax 29 0 4 -6 0 -1 -1 t p f i f f)); -DATA(insert OID = 0 ( 1219 tableoid 26 0 4 -7 0 -1 -1 t p f i f f)); - -/* ---------------- * pg_log - this relation is modified by special purpose access * method code. The following is garbage but is needed * so that the reldesc code works properly. diff --git a/src/include/catalog/pg_class.h b/src/include/catalog/pg_class.h index 0ff37a5093..f908c4a9cc 100644 --- a/src/include/catalog/pg_class.h +++ b/src/include/catalog/pg_class.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pg_class.h,v 1.50 2001/05/30 14:40:13 momjian Exp $ + * $Id: pg_class.h,v 1.51 2001/06/12 05:55:50 tgl Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -29,10 +29,6 @@ /* ---------------- * pg_class definition. cpp turns this into * typedef struct FormData_pg_class - * - * Note: the #if 0, #endif around the BKI_BEGIN.. END block - * below keeps cpp from seeing what is meant for the - * genbki script * ---------------- */ @@ -59,7 +55,6 @@ CATALOG(pg_class) BOOTSTRAP bool relisshared; char relkind; int2 relnatts; - /* * relnatts is the number of user attributes this class has. There * must be exactly this many instances in Class pg_attribute for this @@ -73,7 +68,6 @@ CATALOG(pg_class) BOOTSTRAP bool relhaspkey; /* has PRIMARY KEY (not used) */ bool relhasrules; /* has associated rules */ bool relhassubclass; /* has derived classes */ - /* * relacl may or may not be present, see note above! */ @@ -129,6 +123,8 @@ typedef FormData_pg_class *Form_pg_class; /* ---------------- * initial contents of pg_class + * + * NOTE: only "bootstrapped" relations need to be declared here. * ---------------- */ @@ -150,12 +146,6 @@ DATA(insert OID = 1269 ( pg_log 99 PGUID 0 1269 0 0 0 0 f t s 1 0 0 0 0 0 f DESCR(""); DATA(insert OID = 376 ( pg_xactlock 0 PGUID 0 0 0 0 0 0 f t s 1 0 0 0 0 0 f f f _null_ )); DESCR(""); -DATA(insert OID = 1215 ( pg_attrdef 109 PGUID 0 1215 0 0 0 0 t t r 4 0 0 0 0 0 f f f _null_ )); -DESCR(""); -DATA(insert OID = 1216 ( pg_relcheck 110 PGUID 0 1216 0 0 0 0 t t r 4 0 0 0 0 0 f f f _null_ )); -DESCR(""); -DATA(insert OID = 1219 ( pg_trigger 111 PGUID 0 1219 0 0 0 0 t t r 13 0 0 0 0 0 f f f _null_ )); -DESCR(""); #define RelOid_pg_type 1247 #define RelOid_pg_attribute 1249 @@ -165,9 +155,6 @@ DESCR(""); #define RelOid_pg_group 1261 #define RelOid_pg_database 1262 #define RelOid_pg_log 1269 -#define RelOid_pg_attrdef 1215 -#define RelOid_pg_relcheck 1216 -#define RelOid_pg_trigger 1219 /* Xact lock pseudo-table */ #define XactLockTableId 376 diff --git a/src/include/catalog/pg_listener.h b/src/include/catalog/pg_listener.h index c5eddbad34..47b77bfab2 100644 --- a/src/include/catalog/pg_listener.h +++ b/src/include/catalog/pg_listener.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pg_listener.h,v 1.8 2001/01/24 19:43:21 momjian Exp $ + * $Id: pg_listener.h,v 1.9 2001/06/12 05:55:50 tgl Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -40,6 +40,13 @@ CATALOG(pg_listener) } FormData_pg_listener; /* ---------------- + * Form_pg_listener corresponds to a pointer to a tuple with + * the format of pg_listener relation. + * ---------------- + */ +typedef FormData_pg_listener *Form_pg_listener; + +/* ---------------- * compiler constants for pg_listener * ---------------- */ diff --git a/src/include/catalog/pg_relcheck.h b/src/include/catalog/pg_relcheck.h index cfe072f32f..7c7cd11447 100644 --- a/src/include/catalog/pg_relcheck.h +++ b/src/include/catalog/pg_relcheck.h @@ -27,7 +27,7 @@ * typedef struct FormData_pg_relcheck * ---------------- */ -CATALOG(pg_relcheck) BOOTSTRAP +CATALOG(pg_relcheck) { Oid rcrelid; NameData rcname; diff --git a/src/include/catalog/pg_trigger.h b/src/include/catalog/pg_trigger.h index 1df6f3b953..220c32f119 100644 --- a/src/include/catalog/pg_trigger.h +++ b/src/include/catalog/pg_trigger.h @@ -27,7 +27,7 @@ * typedef struct FormData_pg_trigger * ---------------- */ -CATALOG(pg_trigger) BOOTSTRAP +CATALOG(pg_trigger) { Oid tgrelid; /* triggered relation */ NameData tgname; /* trigger' name */ diff --git a/src/include/catalog/pg_type.h b/src/include/catalog/pg_type.h index 4e877a159c..ffad5a7fe0 100644 --- a/src/include/catalog/pg_type.h +++ b/src/include/catalog/pg_type.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pg_type.h,v 1.108 2001/06/09 21:41:42 tgl Exp $ + * $Id: pg_type.h,v 1.109 2001/06/12 05:55:50 tgl Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -243,10 +243,6 @@ DATA(insert OID = 99 ( pg_log PGUID 4 4 t c t \054 1269 0 int4in int4out int4i /* OIDS 100 - 199 */ -DATA(insert OID = 109 ( pg_attrdef PGUID 4 4 t c t \054 1215 0 int4in int4out int4in int4out i p _null_)); -DATA(insert OID = 110 ( pg_relcheck PGUID 4 4 t c t \054 1216 0 int4in int4out int4in int4out i p _null_)); -DATA(insert OID = 111 ( pg_trigger PGUID 4 4 t c t \054 1219 0 int4in int4out int4in int4out i p _null_)); - /* OIDS 200 - 299 */ DATA(insert OID = 210 ( smgr PGUID 2 12 t b t \054 0 0 smgrin smgrout smgrin smgrout s p _null_ )); diff --git a/src/include/postgres.h b/src/include/postgres.h index 7af72a791e..e4e959d70f 100644 --- a/src/include/postgres.h +++ b/src/include/postgres.h @@ -10,7 +10,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1995, Regents of the University of California * - * $Id: postgres.h,v 1.48 2001/03/23 18:26:01 tgl Exp $ + * $Id: postgres.h,v 1.49 2001/06/12 05:55:50 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -569,18 +569,14 @@ extern int assertTest(int val); * Section 4: genbki macros used by catalog/pg_xxx.h files * ---------------------------------------------------------------- */ -#define CATALOG(x) \ - typedef struct CppConcat(FormData_,x) +#define CATALOG(x) typedef struct CppConcat(FormData_,x) -/* Huh? */ -#define DATA(x) extern int errno -#define DESCR(x) extern int errno -#define DECLARE_INDEX(x) extern int errno -#define DECLARE_UNIQUE_INDEX(x) extern int errno - -#define BUILD_INDICES #define BOOTSTRAP +/* these need to expand into some harmless, repeatable declaration */ +#define DATA(x) extern int errno +#define DESCR(x) extern int errno + #define BKI_BEGIN #define BKI_END diff --git a/src/include/utils/syscache.h b/src/include/utils/syscache.h index 342f7bf8a5..c98bee3f30 100644 --- a/src/include/utils/syscache.h +++ b/src/include/utils/syscache.h @@ -9,7 +9,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: syscache.h,v 1.30 2001/05/07 00:43:26 tgl Exp $ + * $Id: syscache.h,v 1.31 2001/06/12 05:55:50 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -42,20 +42,18 @@ #define INHRELID 11 #define LANGNAME 12 #define LANGOID 13 -#define LISTENREL 14 -#define OPERNAME 15 -#define OPEROID 16 -#define PROCNAME 17 -#define PROCOID 18 -#define RELNAME 19 -#define RELOID 20 -#define RULENAME 21 -#define RULEOID 22 -#define SHADOWNAME 23 -#define SHADOWSYSID 24 -#define STATRELATT 25 -#define TYPENAME 26 -#define TYPEOID 27 +#define OPERNAME 14 +#define OPEROID 15 +#define PROCNAME 16 +#define PROCOID 17 +#define RELNAME 18 +#define RELOID 19 +#define RULENAME 20 +#define SHADOWNAME 21 +#define SHADOWSYSID 22 +#define STATRELATT 23 +#define TYPENAME 24 +#define TYPEOID 25 extern void InitCatalogCache(void); |