summaryrefslogtreecommitdiff
path: root/src/backend/utils/init
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-06-12 05:55:50 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-06-12 05:55:50 +0000
commit1d584f97b9bfe1501f9d2bc5528e7818fa73c235 (patch)
tree59a1a520e2a31718257ca9fa58f7819c8b321ac8 /src/backend/utils/init
parentd2c8358188cc6710e80800827cbb555600fd4b4d (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/backend/utils/init')
-rw-r--r--src/backend/utils/init/globals.c31
1 files changed, 11 insertions, 20 deletions
diff --git a/src/backend/utils/init/globals.c b/src/backend/utils/init/globals.c
index 3efb52fcb9a..7dff67bffbc 100644
--- a/src/backend/utils/init/globals.c
+++ b/src/backend/utils/init/globals.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.57 2001/05/14 20:30:21 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.58 2001/06/12 05:55:50 tgl Exp $
*
* NOTES
* Globals used all over the place should be declared here and not
@@ -30,6 +30,7 @@
#include "miscadmin.h"
#include "storage/backendid.h"
+
ProtocolVersion FrontendProtocol = PG_PROTOCOL_LATEST;
bool Noversion = false;
@@ -84,36 +85,26 @@ int SortMem = 512;
int NBuffers = DEF_NBUFFERS;
-char *IndexedCatalogNames[] = {
- AttributeRelationName,
- ProcedureRelationName,
- TypeRelationName,
- RelationRelationName,
- 0
-};
-
-
/* ----------------
- * we just do a linear search now so there's no requirement that the list
+ * List of relations that are shared across all databases in an installation.
+ *
+ * This used to be binary-searched, requiring that it be kept in sorted order.
+ * We just do a linear search now so there's no requirement that the list
* be ordered. The list is so small it shouldn't make much difference.
* make sure the list is null-terminated
* - jolly 8/19/95
- *
- * OLD COMMENT
- * WARNING WARNING WARNING WARNING WARNING WARNING
- *
- * keep SharedSystemRelationNames[] in SORTED order! A binary search
- * is done on it in catalog.c!
- *
- * XXX this is a serious hack which should be fixed -cim 1/26/90
* ----------------
*/
char *SharedSystemRelationNames[] = {
DatabaseRelationName,
+ DatabaseNameIndex,
+ DatabaseOidIndex,
GroupRelationName,
GroupNameIndex,
GroupSysidIndex,
LogRelationName,
ShadowRelationName,
- 0
+ ShadowNameIndex,
+ ShadowSysidIndex,
+ NULL
};