From 1d584f97b9bfe1501f9d2bc5528e7818fa73c235 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 12 Jun 2001 05:55:50 +0000 Subject: 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. --- doc/src/sgml/bki.sgml | 22 +++++++++++----------- doc/src/sgml/catalogs.sgml | 5 +++-- 2 files changed, 14 insertions(+), 13 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/bki.sgml b/doc/src/sgml/bki.sgml index 2e4b12f91b3..2b90f048e3b 100644 --- a/doc/src/sgml/bki.sgml +++ b/doc/src/sgml/bki.sgml @@ -1,4 +1,6 @@ - + <acronym>BKI</acronym> Backend Interface @@ -15,16 +17,14 @@ - initdb uses BKI files + initdb uses a BKI file to do part of its job when creating a new database cluster. The - input files used by initbd are created as + input file used by initdb is created as part of building and installing Postgres by a program named genbki.sh from some specially formatted C header files in the source tree. The created - BKI files are called global.bki (for global - catalogs) and template1.bki (for the catalogs - initially stored in the template1 database and then duplicated in - every created database) and are normally installed in the + BKI file is called postgres.bki and is + normally installed in the share subdirectory of the installation tree. @@ -39,7 +39,7 @@ This section describes how the Postgres backend interprets BKI files. This description - will be easier to understand if the global.bki + will be easier to understand if the postgres.bki file is at hand as an example. You should also study the source code of initdb to get an idea of how the backend is invoked. @@ -49,7 +49,7 @@ BKI input consists of a sequence of commands. Commands are made up of a number of tokens, depending on the syntax of the command. Tokens are usually separated by whitespace, but need not be if - there is no ambiguity. There is not special command separator; the + there is no ambiguity. There is no special command separator; the next token that syntactically cannot belong to the preceeding command starts a new one. (Usually you would put a new command on a new line, for clarity.) Tokens can be certain key words, special @@ -155,13 +155,13 @@ values and oid_value for its OID. If oid_value is zero - (0) or the clause is ommitted, then the next available OID is + (0) or the clause is omitted, then the next available OID is used. NULL values can be specified using the special key word - _null_. Values containing spaces should be + _null_. Values containing spaces must be double quoted. diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index 27b8314518a..9c3814820dc 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -1,6 +1,6 @@ @@ -645,7 +645,8 @@ relisshared bool - XXX (This is not what it seems to be.) + True if this table is shared across all databases in the + cluster. -- cgit v1.2.3