Commit 7c13781e authored by Tom Lane's avatar Tom Lane

First phase of project to use fixed OIDs for all system catalogs and

indexes.  Extend the macros in include/catalog/*.h to carry the info
about hand-assigned OIDs, and adjust the genbki script and bootstrap
code to make the relations actually get those OIDs.  Remove the small
number of RelOid_pg_foo macros that we had in favor of a complete
set named like the catname.h and indexing.h macros.  Next phase will
get rid of internal use of names for looking up catalogs and indexes;
but this completes the changes forcing an initdb, so it looks like a
good place to commit.
Along the way, I made the shared relations (pg_database etc) not be
'bootstrap' relations any more, so as to reduce the number of hardwired
entries and simplify changing those relations in future.  I'm not
sure whether they ever really needed to be handled as bootstrap
relations, but it seems to work fine to not do so now.
parent 2193a856
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/bki.sgml,v 1.15 2005/04/13 18:54:55 tgl Exp $ $PostgreSQL: pgsql/doc/src/sgml/bki.sgml,v 1.16 2005/04/14 01:38:15 tgl Exp $
--> -->
<chapter id="bki"> <chapter id="bki">
...@@ -58,7 +58,7 @@ $PostgreSQL: pgsql/doc/src/sgml/bki.sgml,v 1.15 2005/04/13 18:54:55 tgl Exp $ ...@@ -58,7 +58,7 @@ $PostgreSQL: pgsql/doc/src/sgml/bki.sgml,v 1.15 2005/04/13 18:54:55 tgl Exp $
</para> </para>
<para> <para>
Lines starting with a <literal>#</literal> are ignored. Lines starting with <literal>#</literal> are ignored.
</para> </para>
</sect1> </sect1>
...@@ -69,11 +69,12 @@ $PostgreSQL: pgsql/doc/src/sgml/bki.sgml,v 1.15 2005/04/13 18:54:55 tgl Exp $ ...@@ -69,11 +69,12 @@ $PostgreSQL: pgsql/doc/src/sgml/bki.sgml,v 1.15 2005/04/13 18:54:55 tgl Exp $
<variablelist> <variablelist>
<varlistentry> <varlistentry>
<term> <term>
create <literal>create</>
<optional>bootstrap</optional> <optional><literal>bootstrap</></optional>
<optional>shared_relation</optional> <optional><literal>shared_relation</></optional>
<optional>without_oids</optional> <optional><literal>without_oids</></optional>
<replaceable class="parameter">tablename</replaceable> <replaceable class="parameter">tablename</replaceable>
<replaceable class="parameter">tableoid</replaceable>
(<replaceable class="parameter">name1</replaceable> = (<replaceable class="parameter">name1</replaceable> =
<replaceable class="parameter">type1</replaceable> <optional>, <replaceable class="parameter">type1</replaceable> <optional>,
<replaceable class="parameter">name2</replaceable> = <replaceable <replaceable class="parameter">name2</replaceable> = <replaceable
...@@ -83,8 +84,9 @@ $PostgreSQL: pgsql/doc/src/sgml/bki.sgml,v 1.15 2005/04/13 18:54:55 tgl Exp $ ...@@ -83,8 +84,9 @@ $PostgreSQL: pgsql/doc/src/sgml/bki.sgml,v 1.15 2005/04/13 18:54:55 tgl Exp $
<listitem> <listitem>
<para> <para>
Create a table named <replaceable Create a table named <replaceable
class="parameter">tablename</replaceable> with the columns given class="parameter">tablename</replaceable>, and having the OID
in parentheses. <replaceable class="parameter">tableoid</replaceable>,
with the columns given in parentheses.
</para> </para>
<para> <para>
...@@ -101,7 +103,9 @@ $PostgreSQL: pgsql/doc/src/sgml/bki.sgml,v 1.15 2005/04/13 18:54:55 tgl Exp $ ...@@ -101,7 +103,9 @@ $PostgreSQL: pgsql/doc/src/sgml/bki.sgml,v 1.15 2005/04/13 18:54:55 tgl Exp $
<type>_aclitem</type> (array). Although it is possible to create <type>_aclitem</type> (array). Although it is possible to create
tables containing columns of other types, this cannot be done until tables containing columns of other types, this cannot be done until
after <structname>pg_type</> has been created and filled with after <structname>pg_type</> has been created and filled with
appropriate entries. appropriate entries. (That effectively means that only these
column types can be used in bootstrapped tables, but non-bootstrap
catalogs can contain any built-in type.)
</para> </para>
<para> <para>
...@@ -125,38 +129,34 @@ $PostgreSQL: pgsql/doc/src/sgml/bki.sgml,v 1.15 2005/04/13 18:54:55 tgl Exp $ ...@@ -125,38 +129,34 @@ $PostgreSQL: pgsql/doc/src/sgml/bki.sgml,v 1.15 2005/04/13 18:54:55 tgl Exp $
<varlistentry> <varlistentry>
<term> <term>
open <replaceable class="parameter">tablename</replaceable> <literal>open</> <replaceable class="parameter">tablename</replaceable>
</term> </term>
<listitem> <listitem>
<para> <para>
Open the table called Open the table named
<replaceable class="parameter">tablename</replaceable> <replaceable class="parameter">tablename</replaceable>
for further manipulation. for insertion of data. Any currently open table is closed.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term> <term>
close <optional><replaceable class="parameter">tablename</replaceable></optional> <literal>close</> <optional><replaceable class="parameter">tablename</replaceable></optional>
</term> </term>
<listitem> <listitem>
<para> <para>
Close the open table called <replaceable Close the open table. The name of the table can be given as a
class="parameter">tablename</replaceable>. It is an error if cross-check, but this is not required.
<replaceable class="parameter">tablename</replaceable> is not
already opened. If no <replaceable
class="parameter">tablename</replaceable> is given, then the
currently open table is closed.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term> <term>
insert <optional>OID = <replaceable class="parameter">oid_value</replaceable></optional> (<replaceable class="parameter">value1</replaceable> <replaceable class="parameter">value2</replaceable> ...) <literal>insert</> <optional><literal>OID =</> <replaceable class="parameter">oid_value</replaceable></optional> <literal>(</> <replaceable class="parameter">value1</replaceable> <replaceable class="parameter">value2</replaceable> ... <literal>)</>
</term> </term>
<listitem> <listitem>
...@@ -181,19 +181,23 @@ $PostgreSQL: pgsql/doc/src/sgml/bki.sgml,v 1.15 2005/04/13 18:54:55 tgl Exp $ ...@@ -181,19 +181,23 @@ $PostgreSQL: pgsql/doc/src/sgml/bki.sgml,v 1.15 2005/04/13 18:54:55 tgl Exp $
<varlistentry> <varlistentry>
<term> <term>
declare <optional>unique</optional> index <replaceable <literal>declare</> <optional><literal>unique</></optional>
class="parameter">indexname</replaceable> on <replaceable <literal>index</> <replaceable class="parameter">indexname</replaceable>
class="parameter">tablename</replaceable> using <replaceable <replaceable class="parameter">indexoid</replaceable>
class="parameter">amname</replaceable> (<replaceable <literal>on</> <replaceable class="parameter">tablename</replaceable>
class="parameter">opclass1</replaceable> <replaceable <literal>using</> <replaceable class="parameter">amname</replaceable>
class="parameter">name1</replaceable> <optional>, ...</optional>) <literal>(</> <replaceable class="parameter">opclass1</replaceable>
<replaceable class="parameter">name1</replaceable>
<optional>, ...</optional> <literal>)</>
</term> </term>
<listitem> <listitem>
<para> <para>
Create an index named <replaceable Create an index named <replaceable
class="parameter">indexname</replaceable> on the table named class="parameter">indexname</replaceable>, having OID
<replaceable class="parameter">tablename</replaceable> using the <replaceable class="parameter">indexoid</replaceable>,
on the table named
<replaceable class="parameter">tablename</replaceable>, using the
<replaceable class="parameter">amname</replaceable> access <replaceable class="parameter">amname</replaceable> access
method. The fields to index are called <replaceable method. The fields to index are called <replaceable
class="parameter">name1</replaceable>, <replaceable class="parameter">name1</replaceable>, <replaceable
...@@ -208,7 +212,7 @@ $PostgreSQL: pgsql/doc/src/sgml/bki.sgml,v 1.15 2005/04/13 18:54:55 tgl Exp $ ...@@ -208,7 +212,7 @@ $PostgreSQL: pgsql/doc/src/sgml/bki.sgml,v 1.15 2005/04/13 18:54:55 tgl Exp $
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term>build indices</term> <term><literal>build indices</></term>
<listitem> <listitem>
<para> <para>
...@@ -220,17 +224,97 @@ $PostgreSQL: pgsql/doc/src/sgml/bki.sgml,v 1.15 2005/04/13 18:54:55 tgl Exp $ ...@@ -220,17 +224,97 @@ $PostgreSQL: pgsql/doc/src/sgml/bki.sgml,v 1.15 2005/04/13 18:54:55 tgl Exp $
</sect1> </sect1>
<sect1 id="bki-structure">
<title>Structure of the Bootstrap <acronym>BKI</acronym> File</title>
<para>
The <literal>open</> command cannot be used until the tables it uses
exist and have entries for the table that is to be opened.
(These minimum tables are <structname>pg_class</>,
<structname>pg_attribute</>, <structname>pg_proc</>, and
<structname>pg_type</>.) To allow those tables themselves to be filled,
<literal>create</> with the <literal>bootstrap</> option implicitly opens
the created table for data insertion.
</para>
<para>
Thus, the structure of the <filename>postgres.bki</filename> file has to
be:
<orderedlist>
<listitem>
<para>
<literal>create bootstrap</> one of the critical tables
</para>
</listitem>
<listitem>
<para>
<literal>insert</> data describing at least the critical tables
</para>
</listitem>
<listitem>
<para>
<literal>close</>
</para>
</listitem>
<listitem>
<para>
Repeat for the other critical tables.
</para>
</listitem>
<listitem>
<para>
<literal>create</> (without <literal>bootstrap</>) a noncritical table
</para>
</listitem>
<listitem>
<para>
<literal>open</>
</para>
</listitem>
<listitem>
<para>
<literal>insert</> desired data
</para>
</listitem>
<listitem>
<para>
<literal>close</>
</para>
</listitem>
<listitem>
<para>
Repeat for the other noncritical tables.
</para>
</listitem>
<listitem>
<para>
Define indexes.
</para>
</listitem>
<listitem>
<para>
<literal>build indices</>
</para>
</listitem>
</orderedlist>
</para>
<para>
There are doubtless other, undocumented ordering dependencies.
</para>
</sect1>
<sect1 id="bki-example"> <sect1 id="bki-example">
<title>Example</title> <title>Example</title>
<para> <para>
The following sequence of commands will create the The following sequence of commands will create the
table <literal>test_table</literal> with two columns table <literal>test_table</literal> with OID 420, having two columns
<literal>cola</literal> and <literal>colb</literal> of type <literal>cola</literal> and <literal>colb</literal> of type
<type>int4</type> and <type>text</type>, respectively, and insert <type>int4</type> and <type>text</type>, respectively, and insert
two rows into the table. two rows into the table.
<programlisting> <programlisting>
create test_table (cola = int4, colb = text) create test_table 420 (cola = int4, colb = text)
open test_table open test_table
insert OID=421 ( 1 "value1" ) insert OID=421 ( 1 "value1" )
insert OID=422 ( 2 _null_ ) insert OID=422 ( 2 _null_ )
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/bootstrap/bootparse.y,v 1.75 2004/12/31 21:59:34 pgsql Exp $ * $PostgreSQL: pgsql/src/backend/bootstrap/bootparse.y,v 1.76 2005/04/14 01:38:15 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -50,6 +50,8 @@ ...@@ -50,6 +50,8 @@
#include "utils/nabstime.h" #include "utils/nabstime.h"
#include "utils/rel.h" #include "utils/rel.h"
#define atooid(x) ((Oid) strtoul((x), NULL, 10))
static void static void
do_start(void) do_start(void)
...@@ -91,11 +93,10 @@ int num_columns_read = 0; ...@@ -91,11 +93,10 @@ int num_columns_read = 0;
%type <ival> boot_const boot_ident %type <ival> boot_const boot_ident
%type <ival> optbootstrap optsharedrelation optwithoutoids %type <ival> optbootstrap optsharedrelation optwithoutoids
%type <ival> boot_tuple boot_tuplelist %type <ival> boot_tuple boot_tuplelist
%type <oidval> optoideq %type <oidval> oidspec optoideq
%token <ival> CONST_P ID %token <ival> CONST_P ID
%token OPEN XCLOSE XCREATE INSERT_TUPLE %token OPEN XCLOSE XCREATE INSERT_TUPLE
%token STRING XDEFINE
%token XDECLARE INDEX ON USING XBUILD INDICES UNIQUE %token XDECLARE INDEX ON USING XBUILD INDICES UNIQUE
%token COMMA EQUALS LPAREN RPAREN %token COMMA EQUALS LPAREN RPAREN
%token OBJ_ID XBOOTSTRAP XSHARED_RELATION XWITHOUT_OIDS NULLVAL %token OBJ_ID XBOOTSTRAP XSHARED_RELATION XWITHOUT_OIDS NULLVAL
...@@ -151,14 +152,15 @@ Boot_CloseStmt: ...@@ -151,14 +152,15 @@ Boot_CloseStmt:
; ;
Boot_CreateStmt: Boot_CreateStmt:
XCREATE optbootstrap optsharedrelation optwithoutoids boot_ident LPAREN XCREATE optbootstrap optsharedrelation optwithoutoids boot_ident oidspec LPAREN
{ {
do_start(); do_start();
numattr = 0; numattr = 0;
elog(DEBUG4, "creating%s%s relation %s", elog(DEBUG4, "creating%s%s relation %s %u",
$2 ? " bootstrap" : "", $2 ? " bootstrap" : "",
$3 ? " shared" : "", $3 ? " shared" : "",
LexIDStr($5)); LexIDStr($5),
$6);
} }
boot_typelist boot_typelist
{ {
...@@ -183,6 +185,7 @@ Boot_CreateStmt: ...@@ -183,6 +185,7 @@ Boot_CreateStmt:
boot_reldesc = heap_create(LexIDStr($5), boot_reldesc = heap_create(LexIDStr($5),
PG_CATALOG_NAMESPACE, PG_CATALOG_NAMESPACE,
$3 ? GLOBALTABLESPACE_OID : 0, $3 ? GLOBALTABLESPACE_OID : 0,
$6,
tupdesc, tupdesc,
RELKIND_RELATION, RELKIND_RELATION,
$3, $3,
...@@ -196,6 +199,7 @@ Boot_CreateStmt: ...@@ -196,6 +199,7 @@ Boot_CreateStmt:
id = heap_create_with_catalog(LexIDStr($5), id = heap_create_with_catalog(LexIDStr($5),
PG_CATALOG_NAMESPACE, PG_CATALOG_NAMESPACE,
$3 ? GLOBALTABLESPACE_OID : 0, $3 ? GLOBALTABLESPACE_OID : 0,
$6,
tupdesc, tupdesc,
RELKIND_RELATION, RELKIND_RELATION,
$3, $3,
...@@ -235,15 +239,16 @@ Boot_InsertStmt: ...@@ -235,15 +239,16 @@ Boot_InsertStmt:
; ;
Boot_DeclareIndexStmt: Boot_DeclareIndexStmt:
XDECLARE INDEX boot_ident ON boot_ident USING boot_ident LPAREN boot_index_params RPAREN XDECLARE INDEX boot_ident oidspec ON boot_ident USING boot_ident LPAREN boot_index_params RPAREN
{ {
do_start(); do_start();
DefineIndex(makeRangeVar(NULL, LexIDStr($5)), DefineIndex(makeRangeVar(NULL, LexIDStr($6)),
LexIDStr($3), LexIDStr($3),
LexIDStr($7), $4,
LexIDStr($8),
NULL, NULL,
$9, $10,
NULL, NIL, NULL, NIL,
false, false, false, false, false, false,
false, false, true, false); false, false, true, false);
...@@ -252,15 +257,16 @@ Boot_DeclareIndexStmt: ...@@ -252,15 +257,16 @@ Boot_DeclareIndexStmt:
; ;
Boot_DeclareUniqueIndexStmt: Boot_DeclareUniqueIndexStmt:
XDECLARE UNIQUE INDEX boot_ident ON boot_ident USING boot_ident LPAREN boot_index_params RPAREN XDECLARE UNIQUE INDEX boot_ident oidspec ON boot_ident USING boot_ident LPAREN boot_index_params RPAREN
{ {
do_start(); do_start();
DefineIndex(makeRangeVar(NULL, LexIDStr($6)), DefineIndex(makeRangeVar(NULL, LexIDStr($7)),
LexIDStr($4), LexIDStr($4),
LexIDStr($8), $5,
LexIDStr($9),
NULL, NULL,
$10, $11,
NULL, NIL, NULL, NIL,
true, false, false, true, false, false,
false, false, true, false); false, false, true, false);
...@@ -323,8 +329,12 @@ boot_type_thing: ...@@ -323,8 +329,12 @@ boot_type_thing:
} }
; ;
oidspec:
boot_ident { $$ = atooid(LexIDStr($1)); }
;
optoideq: optoideq:
OBJ_ID EQUALS boot_ident { $$ = atol(LexIDStr($3)); } OBJ_ID EQUALS oidspec { $$ = $3; }
| { $$ = (Oid) 0; } | { $$ = (Oid) 0; }
; ;
......
$PostgreSQL: pgsql/src/backend/catalog/README,v 1.8 2003/11/29 19:51:42 pgsql Exp $ $PostgreSQL: pgsql/src/backend/catalog/README,v 1.9 2005/04/14 01:38:15 tgl Exp $
This directory contains .c files that manipulate the system catalogs; This directory contains .c files that manipulate the system catalogs;
src/include/catalog contains the .h files that define the structure src/include/catalog contains the .h files that define the structure
...@@ -6,7 +6,7 @@ of the system catalogs. ...@@ -6,7 +6,7 @@ of the system catalogs.
When the compile-time scripts (such as Gen_fmgrtab.sh and genbki.sh) 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 execute, they grep the DATA statements out of the .h files and munge
these in order to generate the .bki files. The .bki files are then 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 used as input to initdb (which is just a wrapper around postgres
running single-user in bootstrapping mode) in order to generate the running single-user in bootstrapping mode) in order to generate the
initial (template) system catalog relation files. initial (template) system catalog relation files.
...@@ -30,8 +30,8 @@ contains back-pointers into pg_type (pg_proc.proargtypes). For such ...@@ -30,8 +30,8 @@ contains back-pointers into pg_type (pg_proc.proargtypes). For such
cases, the OID assigned to a tuple may be explicitly set by use of the cases, the OID assigned to a tuple may be explicitly set by use of the
"OID = n" clause of the .bki insert statement. If no such pointers are "OID = n" clause of the .bki insert statement. If no such pointers are
required to a given tuple, then the OID = n clause may be omitted required to a given tuple, then the OID = n clause may be omitted
(then the system generates a random OID in the usual way, or leaves it (then the system generates an OID in the usual way, or leaves it 0 in a
0 in a catalog that has no OIDs). In practice we usually preassign OIDs catalog that has no OIDs). In practice we usually preassign OIDs
for all or none of the pre-loaded tuples in a given catalog, even if only for all or none of the pre-loaded tuples in a given catalog, even if only
some of them are actually cross-referenced. some of them are actually cross-referenced.
...@@ -39,42 +39,36 @@ some of them are actually cross-referenced. ...@@ -39,42 +39,36 @@ some of them are actually cross-referenced.
be known directly in the C code. In such cases, put a #define in the be known directly in the C code. In such cases, put a #define in the
catalog's .h file, and use the #define symbol in the C code. Writing catalog's .h file, and use the #define symbol in the C code. Writing
the actual numeric value of any OID in C code is considered very bad form. 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 Direct references to pg_proc OIDs are common enough that there's a special
mechanism to create the necessary #define's automatically: see mechanism to create the necessary #define's automatically: see
backend/utils/Gen_fmgrtab.sh. For all the other system catalogs, you have backend/utils/Gen_fmgrtab.sh. We also have standard conventions for setting
to manually create any #define's you need.) 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.
- If you need to find a valid OID for a tuple that will be referred to by - If you need to find a valid OID for a new predefined tuple,
others, use the unused_oids script. It generates inclusive ranges of use the unused_oids script. It generates inclusive ranges of
*unused* OIDs (e.g., the line "45-900" means OIDs 45 through 900 have *unused* OIDs (e.g., the line "45-900" means OIDs 45 through 900 have
not been allocated yet). Currently, OIDs 1-9999 are reserved for manual not been allocated yet). Currently, OIDs 1-9999 are reserved for manual
assignment; the unused_oids script simply looks through the include/catalog assignment; the unused_oids script simply looks through the include/catalog
headers to see which ones do not appear in "OID =" clauses. headers to see which ones do not appear in "OID =" clauses in DATA lines.
(As of Postgres 8.1, it also looks at CATALOG and DECLARE_INDEX lines.)
You can also use the duplicate_oids script to check for mistakes.
- OIDs 10000-16383 are reserved for assignment by the genbki.sh script: - The OID counter starts at 10000 at bootstrap. If a catalog row is in a
it will insert these OIDs if it sees a clause "OID = 0" in a DATA table that requires OIDs, but no OID was preassigned by an "OID =" clause,
statement. You would typically use this feature if you don't care exactly then it will receive an OID of 10000 or above.
which OID is assigned to a catalog row (because it has no cross-references
you need to hardwire) but you want to give it a DESCR entry. The DESCR macro
will not work for rows that don't have any OID at genbki.sh time.
- The OID counter starts at 16384 at bootstrap. If a catalog row is in a
table that requires OIDs, but no OID was preassigned by hand or by genbki.sh,
then it will receive an OID of 16384 or above.
- To create a "BOOTSTRAP" table you have to do a lot of extra work: these - To create a "BOOTSTRAP" table you have to do a lot of extra work: these
tables are not created through a normal CREATE TABLE operation, but spring tables are not created through a normal CREATE TABLE operation, but spring
into existence when first written to during initdb. Therefore, you must into existence when first written to during initdb. Therefore, you must
manually create appropriate entries for them in the pre-loaded contents of manually create appropriate entries for them in the pre-loaded contents of
pg_class, pg_attribute, and pg_type. You'll also need to add code to function pg_class, pg_attribute, and pg_type. Avoid making new catalogs be bootstrap
heap_create() in heap.c to force the correct OID to be assigned when the table
is first referenced. (It's near the top of the function with the comment
beginning in "Real ugly stuff".) Avoid making new catalogs be bootstrap
catalogs if at all possible; generally, only tables that must be written to catalogs if at all possible; generally, only tables that must be written to
in order to create a table should be bootstrapped. in order to create a table should be bootstrapped.
- Certain BOOTSTRAP tables must be at the start of the Makefile - Certain BOOTSTRAP tables must be at the start of the Makefile
POSTGRES_BKI_SRCS variable, as these will not be created through the standard POSTGRES_BKI_SRCS variable, as these cannot be created through the standard
heap_create_with_catalog process, because it needs these tables to exist heap_create_with_catalog process, because it needs these tables to exist
already. The list of files this currently includes is: already. The list of files this currently includes is:
pg_proc.h pg_type.h pg_attribute.h pg_class.h pg_proc.h pg_type.h pg_attribute.h pg_class.h
...@@ -96,7 +90,10 @@ piece of code will likely perform "typetup->typdelim" (or, worse, ...@@ -96,7 +90,10 @@ piece of code will likely perform "typetup->typdelim" (or, worse,
"typetyp->typelem", which follows typdelim). This will result in "typetyp->typelem", which follows typdelim). This will result in
random errors or even segmentation violations. Hence, do NOT insert random errors or even segmentation violations. Hence, do NOT insert
catalog tuples that contain NULL attributes except in their catalog tuples that contain NULL attributes except in their
variable-length portions! variable-length portions! (The bootstrapping code is fairly good about
marking NOT NULL each of the columns that can legally be referenced via
C struct declarations ... but those markings won't be enforced against
DATA commands, so you must get it right in a DATA line.)
- Modification of the catalogs must be performed with the proper - Modification of the catalogs must be performed with the proper
updating of catalog indexes! That is, most catalogs have indexes updating of catalog indexes! That is, most catalogs have indexes
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/catalog/dependency.c,v 1.42 2005/02/22 04:35:34 momjian Exp $ * $PostgreSQL: pgsql/src/backend/catalog/dependency.c,v 1.43 2005/04/14 01:38:15 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -29,8 +29,10 @@ ...@@ -29,8 +29,10 @@
#include "catalog/pg_depend.h" #include "catalog/pg_depend.h"
#include "catalog/pg_language.h" #include "catalog/pg_language.h"
#include "catalog/pg_opclass.h" #include "catalog/pg_opclass.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_rewrite.h" #include "catalog/pg_rewrite.h"
#include "catalog/pg_trigger.h" #include "catalog/pg_trigger.h"
#include "catalog/pg_type.h"
#include "commands/comment.h" #include "commands/comment.h"
#include "commands/defrem.h" #include "commands/defrem.h"
#include "commands/proclang.h" #include "commands/proclang.h"
...@@ -907,7 +909,7 @@ recordDependencyOnSingleRelExpr(const ObjectAddress *depender, ...@@ -907,7 +909,7 @@ recordDependencyOnSingleRelExpr(const ObjectAddress *depender,
{ {
ObjectAddress *thisobj = context.addrs.refs + oldref; ObjectAddress *thisobj = context.addrs.refs + oldref;
if (thisobj->classId == RelOid_pg_class && if (thisobj->classId == RelationRelationId &&
thisobj->objectId == relId) thisobj->objectId == relId)
{ {
/* Move this ref into self_addrs */ /* Move this ref into self_addrs */
...@@ -1305,9 +1307,9 @@ term_object_addresses(ObjectAddresses *addrs) ...@@ -1305,9 +1307,9 @@ term_object_addresses(ObjectAddresses *addrs)
static void static void
init_object_classes(void) init_object_classes(void)
{ {
object_classes[OCLASS_CLASS] = RelOid_pg_class; object_classes[OCLASS_CLASS] = RelationRelationId;
object_classes[OCLASS_PROC] = RelOid_pg_proc; object_classes[OCLASS_PROC] = ProcedureRelationId;
object_classes[OCLASS_TYPE] = RelOid_pg_type; object_classes[OCLASS_TYPE] = TypeRelationId;
object_classes[OCLASS_CAST] = get_system_catalog_relid(CastRelationName); object_classes[OCLASS_CAST] = get_system_catalog_relid(CastRelationName);
object_classes[OCLASS_CONSTRAINT] = get_system_catalog_relid(ConstraintRelationName); object_classes[OCLASS_CONSTRAINT] = get_system_catalog_relid(ConstraintRelationName);
object_classes[OCLASS_CONVERSION] = get_system_catalog_relid(ConversionRelationName); object_classes[OCLASS_CONVERSION] = get_system_catalog_relid(ConversionRelationName);
...@@ -1333,15 +1335,15 @@ getObjectClass(const ObjectAddress *object) ...@@ -1333,15 +1335,15 @@ getObjectClass(const ObjectAddress *object)
/* Easy for the bootstrapped catalogs... */ /* Easy for the bootstrapped catalogs... */
switch (object->classId) switch (object->classId)
{ {
case RelOid_pg_class: case RelationRelationId:
/* caller must check objectSubId */ /* caller must check objectSubId */
return OCLASS_CLASS; return OCLASS_CLASS;
case RelOid_pg_proc: case ProcedureRelationId:
Assert(object->objectSubId == 0); Assert(object->objectSubId == 0);
return OCLASS_PROC; return OCLASS_PROC;
case RelOid_pg_type: case TypeRelationId:
Assert(object->objectSubId == 0); Assert(object->objectSubId == 0);
return OCLASS_TYPE; return OCLASS_TYPE;
} }
...@@ -1560,7 +1562,7 @@ getObjectDescription(const ObjectAddress *object) ...@@ -1560,7 +1562,7 @@ getObjectDescription(const ObjectAddress *object)
attrdef = (Form_pg_attrdef) GETSTRUCT(tup); attrdef = (Form_pg_attrdef) GETSTRUCT(tup);
colobject.classId = RelOid_pg_class; colobject.classId = RelationRelationId;
colobject.objectId = attrdef->adrelid; colobject.objectId = attrdef->adrelid;
colobject.objectSubId = attrdef->adnum; colobject.objectSubId = attrdef->adnum;
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $PostgreSQL: pgsql/src/backend/catalog/genbki.sh,v 1.34 2005/04/13 18:54:56 tgl Exp $ # $PostgreSQL: pgsql/src/backend/catalog/genbki.sh,v 1.35 2005/04/14 01:38:16 tgl Exp $
# #
# NOTES # NOTES
# non-essential whitespace is removed from the generated file. # non-essential whitespace is removed from the generated file.
...@@ -192,7 +192,7 @@ comment_level > 0 { next; } ...@@ -192,7 +192,7 @@ comment_level > 0 { next; }
# ---------------- # ----------------
# DATA() statements are basically passed right through after # DATA() statements are basically passed right through after
# stripping off the DATA( and the ) on the end. # stripping off the DATA( and the ) on the end.
# Remember any explicit OID for use by DESCR(). # Remember the OID for use by DESCR().
# ---------------- # ----------------
/^DATA\(/ { /^DATA\(/ {
data = substr($0, 6, length($0) - 6); data = substr($0, 6, length($0) - 6);
...@@ -221,13 +221,19 @@ comment_level > 0 { next; } ...@@ -221,13 +221,19 @@ comment_level > 0 { next; }
# end any prior catalog data insertions before starting a define index # end any prior catalog data insertions before starting a define index
# ---- # ----
if (reln_open == 1) { if (reln_open == 1) {
# print "show";
print "close " catalog; print "close " catalog;
reln_open = 0; reln_open = 0;
} }
data = substr($0, 15, length($0) - 15); data = substr($0, 15, length($0) - 15);
print "declare index " data pos = index(data, ",");
iname = substr(data, 1, pos-1);
data = substr(data, pos+1, length(data)-pos);
pos = index(data, ",");
ioid = substr(data, 1, pos-1);
data = substr(data, pos+1, length(data)-pos);
print "declare index " iname " " ioid " " data
} }
/^DECLARE_UNIQUE_INDEX\(/ { /^DECLARE_UNIQUE_INDEX\(/ {
...@@ -235,13 +241,19 @@ comment_level > 0 { next; } ...@@ -235,13 +241,19 @@ comment_level > 0 { next; }
# end any prior catalog data insertions before starting a define unique index # end any prior catalog data insertions before starting a define unique index
# ---- # ----
if (reln_open == 1) { if (reln_open == 1) {
# print "show";
print "close " catalog; print "close " catalog;
reln_open = 0; reln_open = 0;
} }
data = substr($0, 22, length($0) - 22); data = substr($0, 22, length($0) - 22);
print "declare unique index " data pos = index(data, ",");
iname = substr(data, 1, pos-1);
data = substr(data, pos+1, length(data)-pos);
pos = index(data, ",");
ioid = substr(data, 1, pos-1);
data = substr(data, pos+1, length(data)-pos);
print "declare unique index " iname " " ioid " " data
} }
/^BUILD_INDICES/ { print "build indices"; } /^BUILD_INDICES/ { print "build indices"; }
...@@ -254,7 +266,6 @@ comment_level > 0 { next; } ...@@ -254,7 +266,6 @@ comment_level > 0 { next; }
# end any prior catalog data insertions before starting a new one.. # end any prior catalog data insertions before starting a new one..
# ---- # ----
if (reln_open == 1) { if (reln_open == 1) {
# print "show";
print "close " catalog; print "close " catalog;
reln_open = 0; reln_open = 0;
} }
...@@ -263,9 +274,12 @@ comment_level > 0 { next; } ...@@ -263,9 +274,12 @@ comment_level > 0 { next; }
# get the name and properties of the new catalog # get the name and properties of the new catalog
# ---- # ----
pos = index($1,")"); pos = index($1,")");
catalog = substr($1,9,pos-9); catalogandoid = substr($1,9,pos-9);
pos = index(catalogandoid, ",");
catalog = substr(catalogandoid, 1, pos-1);
catalogoid = substr(catalogandoid, pos+1, length(catalogandoid)-pos);
if ($0 ~ /BOOTSTRAP/) { if ($0 ~ /BKI_BOOTSTRAP/) {
bootstrap = "bootstrap "; bootstrap = "bootstrap ";
} }
if ($0 ~ /BKI_SHARED_RELATION/) { if ($0 ~ /BKI_SHARED_RELATION/) {
...@@ -298,7 +312,7 @@ inside == 1 { ...@@ -298,7 +312,7 @@ inside == 1 {
# if this is the last line, then output the bki catalog stuff. # if this is the last line, then output the bki catalog stuff.
# ---- # ----
if ($1 ~ /}/) { if ($1 ~ /}/) {
print "create " bootstrap shared_relation without_oids catalog; print "create " bootstrap shared_relation without_oids catalog " " catalogoid;
print "\t("; print "\t(";
for (j=1; j<i-1; j++) { for (j=1; j<i-1; j++) {
...@@ -338,7 +352,6 @@ inside == 1 { ...@@ -338,7 +352,6 @@ inside == 1 {
END { END {
if (reln_open == 1) { if (reln_open == 1) {
# print "show";
print "close " catalog; print "close " catalog;
reln_open = 0; reln_open = 0;
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/catalog/heap.c,v 1.282 2005/04/13 16:50:54 tgl Exp $ * $PostgreSQL: pgsql/src/backend/catalog/heap.c,v 1.283 2005/04/14 01:38:16 tgl Exp $
* *
* *
* INTERFACE ROUTINES * INTERFACE ROUTINES
...@@ -190,23 +190,24 @@ SystemAttributeByName(const char *attname, bool relhasoids) ...@@ -190,23 +190,24 @@ SystemAttributeByName(const char *attname, bool relhasoids)
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
* heap_create - Create an uncataloged heap relation * heap_create - Create an uncataloged heap relation
* *
* relid is normally InvalidOid to specify that this routine should
* generate an OID for the relation. During bootstrap, it can be
* nonzero to specify a preselected OID.
*
* rel->rd_rel is initialized by RelationBuildLocalRelation, * rel->rd_rel is initialized by RelationBuildLocalRelation,
* and is mostly zeroes at return. * and is mostly zeroes at return.
*
* Remove the system relation specific code to elsewhere eventually.
* ---------------------------------------------------------------- * ----------------------------------------------------------------
*/ */
Relation Relation
heap_create(const char *relname, heap_create(const char *relname,
Oid relnamespace, Oid relnamespace,
Oid reltablespace, Oid reltablespace,
Oid relid,
TupleDesc tupDesc, TupleDesc tupDesc,
char relkind, char relkind,
bool shared_relation, bool shared_relation,
bool allow_system_table_mods) bool allow_system_table_mods)
{ {
Oid relid;
bool nailme = false;
bool create_storage; bool create_storage;
Relation rel; Relation rel;
...@@ -223,45 +224,9 @@ heap_create(const char *relname, ...@@ -223,45 +224,9 @@ heap_create(const char *relname,
errdetail("System catalog modifications are currently disallowed."))); errdetail("System catalog modifications are currently disallowed.")));
/* /*
* Real ugly stuff to assign the proper relid in the relation * Allocate an OID for the relation, unless we were told what to use.
* descriptor follows. Note that only "bootstrapped" relations whose
* OIDs are hard-coded in pg_class.h should be listed here. We also
* have to recognize those rels that must be nailed in cache.
*/ */
if (IsSystemNamespace(relnamespace)) if (!OidIsValid(relid))
{
if (strcmp(TypeRelationName, relname) == 0)
{
nailme = true;
relid = RelOid_pg_type;
}
else if (strcmp(AttributeRelationName, relname) == 0)
{
nailme = true;
relid = RelOid_pg_attribute;
}
else if (strcmp(ProcedureRelationName, relname) == 0)
{
nailme = true;
relid = RelOid_pg_proc;
}
else if (strcmp(RelationRelationName, relname) == 0)
{
nailme = true;
relid = RelOid_pg_class;
}
else if (strcmp(ShadowRelationName, relname) == 0)
relid = RelOid_pg_shadow;
else if (strcmp(GroupRelationName, relname) == 0)
relid = RelOid_pg_group;
else if (strcmp(DatabaseRelationName, relname) == 0)
relid = RelOid_pg_database;
else if (strcmp(TableSpaceRelationName, relname) == 0)
relid = RelOid_pg_tablespace;
else
relid = newoid();
}
else
relid = newoid(); relid = newoid();
/* /*
...@@ -312,8 +277,7 @@ heap_create(const char *relname, ...@@ -312,8 +277,7 @@ heap_create(const char *relname,
tupDesc, tupDesc,
relid, relid,
reltablespace, reltablespace,
shared_relation, shared_relation);
nailme);
/* /*
* have the storage manager create the relation's disk file, if * have the storage manager create the relation's disk file, if
...@@ -516,10 +480,10 @@ AddNewAttributeTuples(Oid new_rel_oid, ...@@ -516,10 +480,10 @@ AddNewAttributeTuples(Oid new_rel_oid,
heap_freetuple(tup); heap_freetuple(tup);
myself.classId = RelOid_pg_class; myself.classId = RelationRelationId;
myself.objectId = new_rel_oid; myself.objectId = new_rel_oid;
myself.objectSubId = i + 1; myself.objectSubId = i + 1;
referenced.classId = RelOid_pg_type; referenced.classId = TypeRelationId;
referenced.objectId = (*dpp)->atttypid; referenced.objectId = (*dpp)->atttypid;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
...@@ -706,6 +670,7 @@ Oid ...@@ -706,6 +670,7 @@ Oid
heap_create_with_catalog(const char *relname, heap_create_with_catalog(const char *relname,
Oid relnamespace, Oid relnamespace,
Oid reltablespace, Oid reltablespace,
Oid relid,
TupleDesc tupdesc, TupleDesc tupdesc,
char relkind, char relkind,
bool shared_relation, bool shared_relation,
...@@ -739,6 +704,7 @@ heap_create_with_catalog(const char *relname, ...@@ -739,6 +704,7 @@ heap_create_with_catalog(const char *relname,
new_rel_desc = heap_create(relname, new_rel_desc = heap_create(relname,
relnamespace, relnamespace,
reltablespace, reltablespace,
relid,
tupdesc, tupdesc,
relkind, relkind,
shared_relation, shared_relation,
...@@ -795,7 +761,7 @@ heap_create_with_catalog(const char *relname, ...@@ -795,7 +761,7 @@ heap_create_with_catalog(const char *relname,
ObjectAddress myself, ObjectAddress myself,
referenced; referenced;
myself.classId = RelOid_pg_class; myself.classId = RelationRelationId;
myself.objectId = new_rel_oid; myself.objectId = new_rel_oid;
myself.objectSubId = 0; myself.objectSubId = 0;
referenced.classId = get_system_catalog_relid(NamespaceRelationName); referenced.classId = get_system_catalog_relid(NamespaceRelationName);
...@@ -1316,7 +1282,7 @@ StoreAttrDefault(Relation rel, AttrNumber attnum, char *adbin) ...@@ -1316,7 +1282,7 @@ StoreAttrDefault(Relation rel, AttrNumber attnum, char *adbin)
* Make a dependency so that the pg_attrdef entry goes away if the * Make a dependency so that the pg_attrdef entry goes away if the
* column (or whole table) is deleted. * column (or whole table) is deleted.
*/ */
colobject.classId = RelOid_pg_class; colobject.classId = RelationRelationId;
colobject.objectId = RelationGetRelid(rel); colobject.objectId = RelationGetRelid(rel);
colobject.objectSubId = attnum; colobject.objectSubId = attnum;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/catalog/index.c,v 1.250 2005/03/29 00:16:55 tgl Exp $ * $PostgreSQL: pgsql/src/backend/catalog/index.c,v 1.251 2005/04/14 01:38:16 tgl Exp $
* *
* *
* INTERFACE ROUTINES * INTERFACE ROUTINES
...@@ -443,12 +443,17 @@ UpdateIndexRelation(Oid indexoid, ...@@ -443,12 +443,17 @@ UpdateIndexRelation(Oid indexoid,
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
* index_create * index_create
* *
* indexRelationId is normally InvalidOid to let this routine
* generate an OID for the index. During bootstrap it may be
* nonzero to specify a preselected OID.
*
* Returns OID of the created index. * Returns OID of the created index.
* ---------------------------------------------------------------- * ----------------------------------------------------------------
*/ */
Oid Oid
index_create(Oid heapRelationId, index_create(Oid heapRelationId,
const char *indexRelationName, const char *indexRelationName,
Oid indexRelationId,
IndexInfo *indexInfo, IndexInfo *indexInfo,
Oid accessMethodObjectId, Oid accessMethodObjectId,
Oid tableSpaceId, Oid tableSpaceId,
...@@ -526,6 +531,7 @@ index_create(Oid heapRelationId, ...@@ -526,6 +531,7 @@ index_create(Oid heapRelationId,
indexRelation = heap_create(indexRelationName, indexRelation = heap_create(indexRelationName,
namespaceId, namespaceId,
tableSpaceId, tableSpaceId,
indexRelationId,
indexTupDesc, indexTupDesc,
RELKIND_INDEX, RELKIND_INDEX,
shared_relation, shared_relation,
...@@ -600,7 +606,7 @@ index_create(Oid heapRelationId, ...@@ -600,7 +606,7 @@ index_create(Oid heapRelationId,
ObjectAddress myself, ObjectAddress myself,
referenced; referenced;
myself.classId = RelOid_pg_class; myself.classId = RelationRelationId;
myself.objectId = indexoid; myself.objectId = indexoid;
myself.objectSubId = 0; myself.objectSubId = 0;
...@@ -656,7 +662,7 @@ index_create(Oid heapRelationId, ...@@ -656,7 +662,7 @@ index_create(Oid heapRelationId,
{ {
if (indexInfo->ii_KeyAttrNumbers[i] != 0) if (indexInfo->ii_KeyAttrNumbers[i] != 0)
{ {
referenced.classId = RelOid_pg_class; referenced.classId = RelationRelationId;
referenced.objectId = heapRelationId; referenced.objectId = heapRelationId;
referenced.objectSubId = indexInfo->ii_KeyAttrNumbers[i]; referenced.objectSubId = indexInfo->ii_KeyAttrNumbers[i];
...@@ -1693,7 +1699,7 @@ reindex_relation(Oid relid, bool toast_too) ...@@ -1693,7 +1699,7 @@ reindex_relation(Oid relid, bool toast_too)
* be created with an entry for its own pg_class row because we do * be created with an entry for its own pg_class row because we do
* setNewRelfilenode() before we do index_build(). * setNewRelfilenode() before we do index_build().
*/ */
is_pg_class = (RelationGetRelid(rel) == RelOid_pg_class); is_pg_class = (RelationGetRelid(rel) == RelationRelationId);
doneIndexes = NIL; doneIndexes = NIL;
/* Reindex all the indexes. */ /* Reindex all the indexes. */
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/catalog/pg_aggregate.c,v 1.73 2005/04/12 04:26:17 tgl Exp $ * $PostgreSQL: pgsql/src/backend/catalog/pg_aggregate.c,v 1.74 2005/04/14 01:38:16 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -240,12 +240,12 @@ AggregateCreate(const char *aggName, ...@@ -240,12 +240,12 @@ AggregateCreate(const char *aggName,
* dependency on aggTransType since we depend on it indirectly through * dependency on aggTransType since we depend on it indirectly through
* transfn. * transfn.
*/ */
myself.classId = RelOid_pg_proc; myself.classId = ProcedureRelationId;
myself.objectId = procOid; myself.objectId = procOid;
myself.objectSubId = 0; myself.objectSubId = 0;
/* Depends on transition function */ /* Depends on transition function */
referenced.classId = RelOid_pg_proc; referenced.classId = ProcedureRelationId;
referenced.objectId = transfn; referenced.objectId = transfn;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
...@@ -253,7 +253,7 @@ AggregateCreate(const char *aggName, ...@@ -253,7 +253,7 @@ AggregateCreate(const char *aggName,
/* Depends on final function, if any */ /* Depends on final function, if any */
if (OidIsValid(finalfn)) if (OidIsValid(finalfn))
{ {
referenced.classId = RelOid_pg_proc; referenced.classId = ProcedureRelationId;
referenced.objectId = finalfn; referenced.objectId = finalfn;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/catalog/pg_constraint.c,v 1.23 2005/03/25 21:57:57 tgl Exp $ * $PostgreSQL: pgsql/src/backend/catalog/pg_constraint.c,v 1.24 2005/04/14 01:38:16 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -174,7 +174,7 @@ CreateConstraintEntry(const char *constraintName, ...@@ -174,7 +174,7 @@ CreateConstraintEntry(const char *constraintName,
*/ */
ObjectAddress relobject; ObjectAddress relobject;
relobject.classId = RelOid_pg_class; relobject.classId = RelationRelationId;
relobject.objectId = relId; relobject.objectId = relId;
if (constraintNKeys > 0) if (constraintNKeys > 0)
{ {
...@@ -200,7 +200,7 @@ CreateConstraintEntry(const char *constraintName, ...@@ -200,7 +200,7 @@ CreateConstraintEntry(const char *constraintName,
*/ */
ObjectAddress domobject; ObjectAddress domobject;
domobject.classId = RelOid_pg_type; domobject.classId = TypeRelationId;
domobject.objectId = domainId; domobject.objectId = domainId;
domobject.objectSubId = 0; domobject.objectSubId = 0;
...@@ -215,7 +215,7 @@ CreateConstraintEntry(const char *constraintName, ...@@ -215,7 +215,7 @@ CreateConstraintEntry(const char *constraintName,
*/ */
ObjectAddress relobject; ObjectAddress relobject;
relobject.classId = RelOid_pg_class; relobject.classId = RelationRelationId;
relobject.objectId = foreignRelId; relobject.objectId = foreignRelId;
if (foreignNKeys > 0) if (foreignNKeys > 0)
{ {
...@@ -242,7 +242,7 @@ CreateConstraintEntry(const char *constraintName, ...@@ -242,7 +242,7 @@ CreateConstraintEntry(const char *constraintName,
*/ */
ObjectAddress relobject; ObjectAddress relobject;
relobject.classId = RelOid_pg_class; relobject.classId = RelationRelationId;
relobject.objectId = indexRelId; relobject.objectId = indexRelId;
relobject.objectSubId = 0; relobject.objectSubId = 0;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/catalog/pg_conversion.c,v 1.20 2004/12/31 21:59:38 pgsql Exp $ * $PostgreSQL: pgsql/src/backend/catalog/pg_conversion.c,v 1.21 2005/04/14 01:38:16 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
#include "catalog/catname.h" #include "catalog/catname.h"
#include "catalog/dependency.h" #include "catalog/dependency.h"
#include "catalog/indexing.h" #include "catalog/indexing.h"
#include "catalog/pg_class.h"
#include "catalog/pg_conversion.h" #include "catalog/pg_conversion.h"
#include "catalog/pg_proc.h"
#include "catalog/namespace.h" #include "catalog/namespace.h"
#include "utils/builtins.h" #include "utils/builtins.h"
#include "utils/lsyscache.h" #include "utils/lsyscache.h"
...@@ -116,7 +116,7 @@ ConversionCreate(const char *conname, Oid connamespace, ...@@ -116,7 +116,7 @@ ConversionCreate(const char *conname, Oid connamespace,
myself.objectSubId = 0; myself.objectSubId = 0;
/* create dependency on conversion procedure */ /* create dependency on conversion procedure */
referenced.classId = RelOid_pg_proc; referenced.classId = ProcedureRelationId;
referenced.objectId = conproc; referenced.objectId = conproc;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/catalog/pg_operator.c,v 1.89 2005/03/29 03:01:30 tgl Exp $ * $PostgreSQL: pgsql/src/backend/catalog/pg_operator.c,v 1.90 2005/04/14 01:38:16 tgl Exp $
* *
* NOTES * NOTES
* these routines moved here from commands/define.c and somewhat cleaned up. * these routines moved here from commands/define.c and somewhat cleaned up.
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "catalog/indexing.h" #include "catalog/indexing.h"
#include "catalog/namespace.h" #include "catalog/namespace.h"
#include "catalog/pg_operator.h" #include "catalog/pg_operator.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_type.h" #include "catalog/pg_type.h"
#include "miscadmin.h" #include "miscadmin.h"
#include "parser/parse_func.h" #include "parser/parse_func.h"
...@@ -901,7 +902,7 @@ makeOperatorDependencies(HeapTuple tuple, Oid pg_operator_relid) ...@@ -901,7 +902,7 @@ makeOperatorDependencies(HeapTuple tuple, Oid pg_operator_relid)
/* Dependency on left type */ /* Dependency on left type */
if (OidIsValid(oper->oprleft)) if (OidIsValid(oper->oprleft))
{ {
referenced.classId = RelOid_pg_type; referenced.classId = TypeRelationId;
referenced.objectId = oper->oprleft; referenced.objectId = oper->oprleft;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
...@@ -910,7 +911,7 @@ makeOperatorDependencies(HeapTuple tuple, Oid pg_operator_relid) ...@@ -910,7 +911,7 @@ makeOperatorDependencies(HeapTuple tuple, Oid pg_operator_relid)
/* Dependency on right type */ /* Dependency on right type */
if (OidIsValid(oper->oprright)) if (OidIsValid(oper->oprright))
{ {
referenced.classId = RelOid_pg_type; referenced.classId = TypeRelationId;
referenced.objectId = oper->oprright; referenced.objectId = oper->oprright;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
...@@ -919,7 +920,7 @@ makeOperatorDependencies(HeapTuple tuple, Oid pg_operator_relid) ...@@ -919,7 +920,7 @@ makeOperatorDependencies(HeapTuple tuple, Oid pg_operator_relid)
/* Dependency on result type */ /* Dependency on result type */
if (OidIsValid(oper->oprresult)) if (OidIsValid(oper->oprresult))
{ {
referenced.classId = RelOid_pg_type; referenced.classId = TypeRelationId;
referenced.objectId = oper->oprresult; referenced.objectId = oper->oprresult;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
...@@ -938,7 +939,7 @@ makeOperatorDependencies(HeapTuple tuple, Oid pg_operator_relid) ...@@ -938,7 +939,7 @@ makeOperatorDependencies(HeapTuple tuple, Oid pg_operator_relid)
/* Dependency on implementation function */ /* Dependency on implementation function */
if (OidIsValid(oper->oprcode)) if (OidIsValid(oper->oprcode))
{ {
referenced.classId = RelOid_pg_proc; referenced.classId = ProcedureRelationId;
referenced.objectId = oper->oprcode; referenced.objectId = oper->oprcode;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
...@@ -947,7 +948,7 @@ makeOperatorDependencies(HeapTuple tuple, Oid pg_operator_relid) ...@@ -947,7 +948,7 @@ makeOperatorDependencies(HeapTuple tuple, Oid pg_operator_relid)
/* Dependency on restriction selectivity function */ /* Dependency on restriction selectivity function */
if (OidIsValid(oper->oprrest)) if (OidIsValid(oper->oprrest))
{ {
referenced.classId = RelOid_pg_proc; referenced.classId = ProcedureRelationId;
referenced.objectId = oper->oprrest; referenced.objectId = oper->oprrest;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
...@@ -956,7 +957,7 @@ makeOperatorDependencies(HeapTuple tuple, Oid pg_operator_relid) ...@@ -956,7 +957,7 @@ makeOperatorDependencies(HeapTuple tuple, Oid pg_operator_relid)
/* Dependency on join selectivity function */ /* Dependency on join selectivity function */
if (OidIsValid(oper->oprjoin)) if (OidIsValid(oper->oprjoin))
{ {
referenced.classId = RelOid_pg_proc; referenced.classId = ProcedureRelationId;
referenced.objectId = oper->oprjoin; referenced.objectId = oper->oprjoin;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/catalog/pg_proc.c,v 1.126 2005/03/31 22:46:06 tgl Exp $ * $PostgreSQL: pgsql/src/backend/catalog/pg_proc.c,v 1.127 2005/04/14 01:38:16 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -329,9 +329,9 @@ ProcedureCreate(const char *procedureName, ...@@ -329,9 +329,9 @@ ProcedureCreate(const char *procedureName,
* existing function, first delete any existing pg_depend entries. * existing function, first delete any existing pg_depend entries.
*/ */
if (is_update) if (is_update)
deleteDependencyRecordsFor(RelOid_pg_proc, retval); deleteDependencyRecordsFor(ProcedureRelationId, retval);
myself.classId = RelOid_pg_proc; myself.classId = ProcedureRelationId;
myself.objectId = retval; myself.objectId = retval;
myself.objectSubId = 0; myself.objectSubId = 0;
...@@ -348,7 +348,7 @@ ProcedureCreate(const char *procedureName, ...@@ -348,7 +348,7 @@ ProcedureCreate(const char *procedureName,
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
/* dependency on return type */ /* dependency on return type */
referenced.classId = RelOid_pg_type; referenced.classId = TypeRelationId;
referenced.objectId = returnType; referenced.objectId = returnType;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
...@@ -356,7 +356,7 @@ ProcedureCreate(const char *procedureName, ...@@ -356,7 +356,7 @@ ProcedureCreate(const char *procedureName,
/* dependency on parameter types */ /* dependency on parameter types */
for (i = 0; i < allParamCount; i++) for (i = 0; i < allParamCount; i++)
{ {
referenced.classId = RelOid_pg_type; referenced.classId = TypeRelationId;
referenced.objectId = allParams[i]; referenced.objectId = allParams[i];
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/catalog/pg_type.c,v 1.98 2005/01/27 23:23:51 neilc Exp $ * $PostgreSQL: pgsql/src/backend/catalog/pg_type.c,v 1.99 2005/04/14 01:38:16 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "catalog/catname.h" #include "catalog/catname.h"
#include "catalog/dependency.h" #include "catalog/dependency.h"
#include "catalog/indexing.h" #include "catalog/indexing.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_type.h" #include "catalog/pg_type.h"
#include "miscadmin.h" #include "miscadmin.h"
#include "utils/builtins.h" #include "utils/builtins.h"
...@@ -378,10 +379,9 @@ GenerateTypeDependencies(Oid typeNamespace, ...@@ -378,10 +379,9 @@ GenerateTypeDependencies(Oid typeNamespace,
referenced; referenced;
if (rebuild) if (rebuild)
deleteDependencyRecordsFor(RelOid_pg_type, deleteDependencyRecordsFor(TypeRelationId, typeObjectId);
typeObjectId);
myself.classId = RelOid_pg_type; myself.classId = TypeRelationId;
myself.objectId = typeObjectId; myself.objectId = typeObjectId;
myself.objectSubId = 0; myself.objectSubId = 0;
...@@ -398,7 +398,7 @@ GenerateTypeDependencies(Oid typeNamespace, ...@@ -398,7 +398,7 @@ GenerateTypeDependencies(Oid typeNamespace,
/* Normal dependencies on the I/O functions */ /* Normal dependencies on the I/O functions */
if (OidIsValid(inputProcedure)) if (OidIsValid(inputProcedure))
{ {
referenced.classId = RelOid_pg_proc; referenced.classId = ProcedureRelationId;
referenced.objectId = inputProcedure; referenced.objectId = inputProcedure;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
...@@ -406,7 +406,7 @@ GenerateTypeDependencies(Oid typeNamespace, ...@@ -406,7 +406,7 @@ GenerateTypeDependencies(Oid typeNamespace,
if (OidIsValid(outputProcedure)) if (OidIsValid(outputProcedure))
{ {
referenced.classId = RelOid_pg_proc; referenced.classId = ProcedureRelationId;
referenced.objectId = outputProcedure; referenced.objectId = outputProcedure;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
...@@ -414,7 +414,7 @@ GenerateTypeDependencies(Oid typeNamespace, ...@@ -414,7 +414,7 @@ GenerateTypeDependencies(Oid typeNamespace,
if (OidIsValid(receiveProcedure)) if (OidIsValid(receiveProcedure))
{ {
referenced.classId = RelOid_pg_proc; referenced.classId = ProcedureRelationId;
referenced.objectId = receiveProcedure; referenced.objectId = receiveProcedure;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
...@@ -422,7 +422,7 @@ GenerateTypeDependencies(Oid typeNamespace, ...@@ -422,7 +422,7 @@ GenerateTypeDependencies(Oid typeNamespace,
if (OidIsValid(sendProcedure)) if (OidIsValid(sendProcedure))
{ {
referenced.classId = RelOid_pg_proc; referenced.classId = ProcedureRelationId;
referenced.objectId = sendProcedure; referenced.objectId = sendProcedure;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
...@@ -430,7 +430,7 @@ GenerateTypeDependencies(Oid typeNamespace, ...@@ -430,7 +430,7 @@ GenerateTypeDependencies(Oid typeNamespace,
if (OidIsValid(analyzeProcedure)) if (OidIsValid(analyzeProcedure))
{ {
referenced.classId = RelOid_pg_proc; referenced.classId = ProcedureRelationId;
referenced.objectId = analyzeProcedure; referenced.objectId = analyzeProcedure;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
...@@ -448,7 +448,7 @@ GenerateTypeDependencies(Oid typeNamespace, ...@@ -448,7 +448,7 @@ GenerateTypeDependencies(Oid typeNamespace,
*/ */
if (OidIsValid(relationOid)) if (OidIsValid(relationOid))
{ {
referenced.classId = RelOid_pg_class; referenced.classId = RelationRelationId;
referenced.objectId = relationOid; referenced.objectId = relationOid;
referenced.objectSubId = 0; referenced.objectSubId = 0;
...@@ -467,7 +467,7 @@ GenerateTypeDependencies(Oid typeNamespace, ...@@ -467,7 +467,7 @@ GenerateTypeDependencies(Oid typeNamespace,
*/ */
if (OidIsValid(elementType)) if (OidIsValid(elementType))
{ {
referenced.classId = RelOid_pg_type; referenced.classId = TypeRelationId;
referenced.objectId = elementType; referenced.objectId = elementType;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_AUTO); recordDependencyOn(&myself, &referenced, DEPENDENCY_AUTO);
...@@ -476,7 +476,7 @@ GenerateTypeDependencies(Oid typeNamespace, ...@@ -476,7 +476,7 @@ GenerateTypeDependencies(Oid typeNamespace,
/* Normal dependency from a domain to its base type. */ /* Normal dependency from a domain to its base type. */
if (OidIsValid(baseType)) if (OidIsValid(baseType))
{ {
referenced.classId = RelOid_pg_type; referenced.classId = TypeRelationId;
referenced.objectId = baseType; referenced.objectId = baseType;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/aggregatecmds.c,v 1.24 2005/04/12 04:26:20 tgl Exp $ * $PostgreSQL: pgsql/src/backend/commands/aggregatecmds.c,v 1.25 2005/04/14 01:38:16 tgl Exp $
* *
* DESCRIPTION * DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the * The "DefineFoo" routines take the parse tree and pick out the
...@@ -206,7 +206,7 @@ RemoveAggregate(RemoveAggrStmt *stmt) ...@@ -206,7 +206,7 @@ RemoveAggregate(RemoveAggrStmt *stmt)
/* /*
* Do the deletion * Do the deletion
*/ */
object.classId = RelOid_pg_proc; object.classId = ProcedureRelationId;
object.objectId = procOid; object.objectId = procOid;
object.objectSubId = 0; object.objectSubId = 0;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/cluster.c,v 1.134 2005/03/29 00:16:57 tgl Exp $ * $PostgreSQL: pgsql/src/backend/commands/cluster.c,v 1.135 2005/04/14 01:38:16 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -527,7 +527,7 @@ rebuild_relation(Relation OldHeap, Oid indexOid) ...@@ -527,7 +527,7 @@ rebuild_relation(Relation OldHeap, Oid indexOid)
CommandCounterIncrement(); CommandCounterIncrement();
/* Destroy new heap with old filenode */ /* Destroy new heap with old filenode */
object.classId = RelOid_pg_class; object.classId = RelationRelationId;
object.objectId = OIDNewHeap; object.objectId = OIDNewHeap;
object.objectSubId = 0; object.objectSubId = 0;
...@@ -570,6 +570,7 @@ make_new_heap(Oid OIDOldHeap, const char *NewName, Oid NewTableSpace) ...@@ -570,6 +570,7 @@ make_new_heap(Oid OIDOldHeap, const char *NewName, Oid NewTableSpace)
OIDNewHeap = heap_create_with_catalog(NewName, OIDNewHeap = heap_create_with_catalog(NewName,
RelationGetNamespace(OldHeap), RelationGetNamespace(OldHeap),
NewTableSpace, NewTableSpace,
InvalidOid,
tupdesc, tupdesc,
OldHeap->rd_rel->relkind, OldHeap->rd_rel->relkind,
OldHeap->rd_rel->relisshared, OldHeap->rd_rel->relisshared,
...@@ -799,7 +800,7 @@ swap_relation_files(Oid r1, Oid r2) ...@@ -799,7 +800,7 @@ swap_relation_files(Oid r1, Oid r2)
/* Delete old dependencies */ /* Delete old dependencies */
if (relform1->reltoastrelid) if (relform1->reltoastrelid)
{ {
count = deleteDependencyRecordsFor(RelOid_pg_class, count = deleteDependencyRecordsFor(RelationRelationId,
relform1->reltoastrelid); relform1->reltoastrelid);
if (count != 1) if (count != 1)
elog(ERROR, "expected one dependency record for TOAST table, found %ld", elog(ERROR, "expected one dependency record for TOAST table, found %ld",
...@@ -807,7 +808,7 @@ swap_relation_files(Oid r1, Oid r2) ...@@ -807,7 +808,7 @@ swap_relation_files(Oid r1, Oid r2)
} }
if (relform2->reltoastrelid) if (relform2->reltoastrelid)
{ {
count = deleteDependencyRecordsFor(RelOid_pg_class, count = deleteDependencyRecordsFor(RelationRelationId,
relform2->reltoastrelid); relform2->reltoastrelid);
if (count != 1) if (count != 1)
elog(ERROR, "expected one dependency record for TOAST table, found %ld", elog(ERROR, "expected one dependency record for TOAST table, found %ld",
...@@ -815,9 +816,9 @@ swap_relation_files(Oid r1, Oid r2) ...@@ -815,9 +816,9 @@ swap_relation_files(Oid r1, Oid r2)
} }
/* Register new dependencies */ /* Register new dependencies */
baseobject.classId = RelOid_pg_class; baseobject.classId = RelationRelationId;
baseobject.objectSubId = 0; baseobject.objectSubId = 0;
toastobject.classId = RelOid_pg_class; toastobject.classId = RelationRelationId;
toastobject.objectSubId = 0; toastobject.objectSubId = 0;
if (relform1->reltoastrelid) if (relform1->reltoastrelid)
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Copyright (c) 1996-2005, PostgreSQL Global Development Group * Copyright (c) 1996-2005, PostgreSQL Global Development Group
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/comment.c,v 1.81 2005/01/27 23:23:54 neilc Exp $ * $PostgreSQL: pgsql/src/backend/commands/comment.c,v 1.82 2005/04/14 01:38:16 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -20,9 +20,11 @@ ...@@ -20,9 +20,11 @@
#include "catalog/indexing.h" #include "catalog/indexing.h"
#include "catalog/namespace.h" #include "catalog/namespace.h"
#include "catalog/pg_constraint.h" #include "catalog/pg_constraint.h"
#include "catalog/pg_database.h"
#include "catalog/pg_description.h" #include "catalog/pg_description.h"
#include "catalog/pg_largeobject.h" #include "catalog/pg_largeobject.h"
#include "catalog/pg_operator.h" #include "catalog/pg_operator.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_rewrite.h" #include "catalog/pg_rewrite.h"
#include "catalog/pg_trigger.h" #include "catalog/pg_trigger.h"
#include "catalog/pg_type.h" #include "catalog/pg_type.h"
...@@ -352,7 +354,7 @@ CommentRelation(int objtype, List *relname, char *comment) ...@@ -352,7 +354,7 @@ CommentRelation(int objtype, List *relname, char *comment)
/* Create the comment using the relation's oid */ /* Create the comment using the relation's oid */
CreateComments(RelationGetRelid(relation), RelOid_pg_class, 0, comment); CreateComments(RelationGetRelid(relation), RelationRelationId, 0, comment);
/* Done, but hold lock until commit */ /* Done, but hold lock until commit */
relation_close(relation, NoLock); relation_close(relation, NoLock);
...@@ -406,7 +408,7 @@ CommentAttribute(List *qualname, char *comment) ...@@ -406,7 +408,7 @@ CommentAttribute(List *qualname, char *comment)
/* Create the comment using the relation's oid */ /* Create the comment using the relation's oid */
CreateComments(RelationGetRelid(relation), RelOid_pg_class, CreateComments(RelationGetRelid(relation), RelationRelationId,
(int32) attnum, comment); (int32) attnum, comment);
/* Done, but hold lock until commit */ /* Done, but hold lock until commit */
...@@ -475,7 +477,7 @@ CommentDatabase(List *qualname, char *comment) ...@@ -475,7 +477,7 @@ CommentDatabase(List *qualname, char *comment)
database); database);
/* Create the comment with the pg_database oid */ /* Create the comment with the pg_database oid */
CreateComments(oid, RelOid_pg_database, 0, comment); CreateComments(oid, DatabaseRelationId, 0, comment);
} }
/* /*
...@@ -670,7 +672,7 @@ CommentType(List *typename, char *comment) ...@@ -670,7 +672,7 @@ CommentType(List *typename, char *comment)
/* Call CreateComments() to create/drop the comments */ /* Call CreateComments() to create/drop the comments */
CreateComments(oid, RelOid_pg_type, 0, comment); CreateComments(oid, TypeRelationId, 0, comment);
} }
/* /*
...@@ -706,7 +708,7 @@ CommentAggregate(List *aggregate, List *arguments, char *comment) ...@@ -706,7 +708,7 @@ CommentAggregate(List *aggregate, List *arguments, char *comment)
/* Call CreateComments() to create/drop the comments */ /* Call CreateComments() to create/drop the comments */
CreateComments(oid, RelOid_pg_proc, 0, comment); CreateComments(oid, ProcedureRelationId, 0, comment);
} }
/* /*
...@@ -735,7 +737,7 @@ CommentProc(List *function, List *arguments, char *comment) ...@@ -735,7 +737,7 @@ CommentProc(List *function, List *arguments, char *comment)
/* Call CreateComments() to create/drop the comments */ /* Call CreateComments() to create/drop the comments */
CreateComments(oid, RelOid_pg_proc, 0, comment); CreateComments(oid, ProcedureRelationId, 0, comment);
} }
/* /*
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.59 2005/03/31 22:46:07 tgl Exp $ * $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.60 2005/04/14 01:38:16 tgl Exp $
* *
* DESCRIPTION * DESCRIPTION
* These routines take the parse tree and pick out the * These routines take the parse tree and pick out the
...@@ -719,7 +719,7 @@ RemoveFunction(RemoveFuncStmt *stmt) ...@@ -719,7 +719,7 @@ RemoveFunction(RemoveFuncStmt *stmt)
/* /*
* Do the deletion * Do the deletion
*/ */
object.classId = RelOid_pg_proc; object.classId = ProcedureRelationId;
object.objectId = funcOid; object.objectId = funcOid;
object.objectSubId = 0; object.objectSubId = 0;
...@@ -1304,13 +1304,13 @@ CreateCast(CreateCastStmt *stmt) ...@@ -1304,13 +1304,13 @@ CreateCast(CreateCastStmt *stmt)
myself.objectSubId = 0; myself.objectSubId = 0;
/* dependency on source type */ /* dependency on source type */
referenced.classId = RelOid_pg_type; referenced.classId = TypeRelationId;
referenced.objectId = sourcetypeid; referenced.objectId = sourcetypeid;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
/* dependency on target type */ /* dependency on target type */
referenced.classId = RelOid_pg_type; referenced.classId = TypeRelationId;
referenced.objectId = targettypeid; referenced.objectId = targettypeid;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
...@@ -1318,7 +1318,7 @@ CreateCast(CreateCastStmt *stmt) ...@@ -1318,7 +1318,7 @@ CreateCast(CreateCastStmt *stmt)
/* dependency on function */ /* dependency on function */
if (OidIsValid(funcid)) if (OidIsValid(funcid))
{ {
referenced.classId = RelOid_pg_proc; referenced.classId = ProcedureRelationId;
referenced.objectId = funcid; referenced.objectId = funcid;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/indexcmds.c,v 1.128 2004/12/31 21:59:41 pgsql Exp $ * $PostgreSQL: pgsql/src/backend/commands/indexcmds.c,v 1.129 2005/04/14 01:38:16 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -65,6 +65,8 @@ static bool relationHasPrimaryKey(Relation rel); ...@@ -65,6 +65,8 @@ static bool relationHasPrimaryKey(Relation rel);
* 'heapRelation': the relation the index will apply to. * 'heapRelation': the relation the index will apply to.
* 'indexRelationName': the name for the new index, or NULL to indicate * 'indexRelationName': the name for the new index, or NULL to indicate
* that a nonconflicting default name should be picked. * that a nonconflicting default name should be picked.
* 'indexRelationId': normally InvalidOid, but during bootstrap can be
* nonzero to specify a preselected OID for the index.
* 'accessMethodName': name of the AM to use. * 'accessMethodName': name of the AM to use.
* 'tableSpaceName': name of the tablespace to create the index in. * 'tableSpaceName': name of the tablespace to create the index in.
* NULL specifies using the appropriate default. * NULL specifies using the appropriate default.
...@@ -86,6 +88,7 @@ static bool relationHasPrimaryKey(Relation rel); ...@@ -86,6 +88,7 @@ static bool relationHasPrimaryKey(Relation rel);
void void
DefineIndex(RangeVar *heapRelation, DefineIndex(RangeVar *heapRelation,
char *indexRelationName, char *indexRelationName,
Oid indexRelationId,
char *accessMethodName, char *accessMethodName,
char *tableSpaceName, char *tableSpaceName,
List *attributeList, List *attributeList,
...@@ -379,7 +382,7 @@ DefineIndex(RangeVar *heapRelation, ...@@ -379,7 +382,7 @@ DefineIndex(RangeVar *heapRelation,
primary ? "PRIMARY KEY" : "UNIQUE", primary ? "PRIMARY KEY" : "UNIQUE",
indexRelationName, RelationGetRelationName(rel)))); indexRelationName, RelationGetRelationName(rel))));
index_create(relationId, indexRelationName, index_create(relationId, indexRelationName, indexRelationId,
indexInfo, accessMethodId, tablespaceId, classObjectId, indexInfo, accessMethodId, tablespaceId, classObjectId,
primary, isconstraint, primary, isconstraint,
allowSystemTableMods, skip_build); allowSystemTableMods, skip_build);
...@@ -887,7 +890,7 @@ RemoveIndex(RangeVar *relation, DropBehavior behavior) ...@@ -887,7 +890,7 @@ RemoveIndex(RangeVar *relation, DropBehavior behavior)
errmsg("\"%s\" is not an index", errmsg("\"%s\" is not an index",
relation->relname))); relation->relname)));
object.classId = RelOid_pg_class; object.classId = RelationRelationId;
object.objectId = indOid; object.objectId = indOid;
object.objectSubId = 0; object.objectSubId = 0;
...@@ -1027,7 +1030,7 @@ ReindexDatabase(const char *dbname, bool force /* currently unused */ , ...@@ -1027,7 +1030,7 @@ ReindexDatabase(const char *dbname, bool force /* currently unused */ ,
* reindexing itself will try to update pg_class. * reindexing itself will try to update pg_class.
*/ */
old = MemoryContextSwitchTo(private_context); old = MemoryContextSwitchTo(private_context);
relids = lappend_oid(relids, RelOid_pg_class); relids = lappend_oid(relids, RelationRelationId);
MemoryContextSwitchTo(old); MemoryContextSwitchTo(old);
/* /*
...@@ -1057,7 +1060,7 @@ ReindexDatabase(const char *dbname, bool force /* currently unused */ , ...@@ -1057,7 +1060,7 @@ ReindexDatabase(const char *dbname, bool force /* currently unused */ ,
continue; continue;
} }
if (HeapTupleGetOid(tuple) == RelOid_pg_class) if (HeapTupleGetOid(tuple) == RelationRelationId)
continue; /* got it already */ continue; /* got it already */
old = MemoryContextSwitchTo(private_context); old = MemoryContextSwitchTo(private_context);
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/opclasscmds.c,v 1.30 2005/03/29 00:16:57 tgl Exp $ * $PostgreSQL: pgsql/src/backend/commands/opclasscmds.c,v 1.31 2005/04/14 01:38:16 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -356,7 +356,7 @@ DefineOpClass(CreateOpClassStmt *stmt) ...@@ -356,7 +356,7 @@ DefineOpClass(CreateOpClassStmt *stmt)
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
/* dependency on indexed datatype */ /* dependency on indexed datatype */
referenced.classId = RelOid_pg_type; referenced.classId = TypeRelationId;
referenced.objectId = typeoid; referenced.objectId = typeoid;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
...@@ -364,7 +364,7 @@ DefineOpClass(CreateOpClassStmt *stmt) ...@@ -364,7 +364,7 @@ DefineOpClass(CreateOpClassStmt *stmt)
/* dependency on storage datatype */ /* dependency on storage datatype */
if (OidIsValid(storageoid)) if (OidIsValid(storageoid))
{ {
referenced.classId = RelOid_pg_type; referenced.classId = TypeRelationId;
referenced.objectId = storageoid; referenced.objectId = storageoid;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
...@@ -386,7 +386,7 @@ DefineOpClass(CreateOpClassStmt *stmt) ...@@ -386,7 +386,7 @@ DefineOpClass(CreateOpClassStmt *stmt)
{ {
OpClassMember *proc = (OpClassMember *) lfirst(l); OpClassMember *proc = (OpClassMember *) lfirst(l);
referenced.classId = RelOid_pg_proc; referenced.classId = ProcedureRelationId;
referenced.objectId = proc->object; referenced.objectId = proc->object;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/proclang.c,v 1.58 2005/03/29 03:01:30 tgl Exp $ * $PostgreSQL: pgsql/src/backend/commands/proclang.c,v 1.59 2005/04/14 01:38:16 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -149,7 +149,7 @@ CreateProceduralLanguage(CreatePLangStmt *stmt) ...@@ -149,7 +149,7 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
myself.objectSubId = 0; myself.objectSubId = 0;
/* dependency on the PL handler function */ /* dependency on the PL handler function */
referenced.classId = RelOid_pg_proc; referenced.classId = ProcedureRelationId;
referenced.objectId = procOid; referenced.objectId = procOid;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
...@@ -157,7 +157,7 @@ CreateProceduralLanguage(CreatePLangStmt *stmt) ...@@ -157,7 +157,7 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
/* dependency on the validator function, if any */ /* dependency on the validator function, if any */
if (OidIsValid(valProcOid)) if (OidIsValid(valProcOid))
{ {
referenced.classId = RelOid_pg_proc; referenced.classId = ProcedureRelationId;
referenced.objectId = valProcOid; referenced.objectId = valProcOid;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.153 2005/04/13 16:50:54 tgl Exp $ * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.154 2005/04/14 01:38:17 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -424,6 +424,7 @@ DefineRelation(CreateStmt *stmt, char relkind) ...@@ -424,6 +424,7 @@ DefineRelation(CreateStmt *stmt, char relkind)
relationId = heap_create_with_catalog(relname, relationId = heap_create_with_catalog(relname,
namespaceId, namespaceId,
tablespaceId, tablespaceId,
InvalidOid,
descriptor, descriptor,
relkind, relkind,
false, false,
...@@ -517,7 +518,7 @@ RemoveRelation(const RangeVar *relation, DropBehavior behavior) ...@@ -517,7 +518,7 @@ RemoveRelation(const RangeVar *relation, DropBehavior behavior)
relOid = RangeVarGetRelid(relation, false); relOid = RangeVarGetRelid(relation, false);
object.classId = RelOid_pg_class; object.classId = RelationRelationId;
object.objectId = relOid; object.objectId = relOid;
object.objectSubId = 0; object.objectSubId = 0;
...@@ -1163,10 +1164,10 @@ StoreCatalogInheritance(Oid relationId, List *supers) ...@@ -1163,10 +1164,10 @@ StoreCatalogInheritance(Oid relationId, List *supers)
/* /*
* Store a dependency too * Store a dependency too
*/ */
parentobject.classId = RelOid_pg_class; parentobject.classId = RelationRelationId;
parentobject.objectId = parentOid; parentobject.objectId = parentOid;
parentobject.objectSubId = 0; parentobject.objectSubId = 0;
childobject.classId = RelOid_pg_class; childobject.classId = RelationRelationId;
childobject.objectId = relationId; childobject.objectId = relationId;
childobject.objectSubId = 0; childobject.objectSubId = 0;
...@@ -2293,7 +2294,7 @@ ATRewriteTables(List **wqueue) ...@@ -2293,7 +2294,7 @@ ATRewriteTables(List **wqueue)
CommandCounterIncrement(); CommandCounterIncrement();
/* Destroy new heap with old filenode */ /* Destroy new heap with old filenode */
object.classId = RelOid_pg_class; object.classId = RelationRelationId;
object.objectId = OIDNewHeap; object.objectId = OIDNewHeap;
object.objectSubId = 0; object.objectSubId = 0;
...@@ -2776,7 +2777,7 @@ find_composite_type_dependencies(Oid typeOid, const char *origTblName) ...@@ -2776,7 +2777,7 @@ find_composite_type_dependencies(Oid typeOid, const char *origTblName)
ScanKeyInit(&key[0], ScanKeyInit(&key[0],
Anum_pg_depend_refclassid, Anum_pg_depend_refclassid,
BTEqualStrategyNumber, F_OIDEQ, BTEqualStrategyNumber, F_OIDEQ,
ObjectIdGetDatum(RelOid_pg_type)); ObjectIdGetDatum(TypeRelationId));
ScanKeyInit(&key[1], ScanKeyInit(&key[1],
Anum_pg_depend_refobjid, Anum_pg_depend_refobjid,
BTEqualStrategyNumber, F_OIDEQ, BTEqualStrategyNumber, F_OIDEQ,
...@@ -2793,7 +2794,7 @@ find_composite_type_dependencies(Oid typeOid, const char *origTblName) ...@@ -2793,7 +2794,7 @@ find_composite_type_dependencies(Oid typeOid, const char *origTblName)
/* Ignore dependees that aren't user columns of relations */ /* Ignore dependees that aren't user columns of relations */
/* (we assume system columns are never of rowtypes) */ /* (we assume system columns are never of rowtypes) */
if (pg_depend->classid != RelOid_pg_class || if (pg_depend->classid != RelationRelationId ||
pg_depend->objsubid <= 0) pg_depend->objsubid <= 0)
continue; continue;
...@@ -3112,10 +3113,10 @@ add_column_datatype_dependency(Oid relid, int32 attnum, Oid typid) ...@@ -3112,10 +3113,10 @@ add_column_datatype_dependency(Oid relid, int32 attnum, Oid typid)
ObjectAddress myself, ObjectAddress myself,
referenced; referenced;
myself.classId = RelOid_pg_class; myself.classId = RelationRelationId;
myself.objectId = relid; myself.objectId = relid;
myself.objectSubId = attnum; myself.objectSubId = attnum;
referenced.classId = RelOid_pg_type; referenced.classId = TypeRelationId;
referenced.objectId = typid; referenced.objectId = typid;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
...@@ -3130,10 +3131,10 @@ add_column_support_dependency(Oid relid, int32 attnum, RangeVar *support) ...@@ -3130,10 +3131,10 @@ add_column_support_dependency(Oid relid, int32 attnum, RangeVar *support)
ObjectAddress colobject, ObjectAddress colobject,
suppobject; suppobject;
colobject.classId = RelOid_pg_class; colobject.classId = RelationRelationId;
colobject.objectId = relid; colobject.objectId = relid;
colobject.objectSubId = attnum; colobject.objectSubId = attnum;
suppobject.classId = RelOid_pg_class; suppobject.classId = RelationRelationId;
suppobject.objectId = RangeVarGetRelid(support, false); suppobject.objectId = RangeVarGetRelid(support, false);
suppobject.objectSubId = 0; suppobject.objectSubId = 0;
recordDependencyOn(&suppobject, &colobject, DEPENDENCY_INTERNAL); recordDependencyOn(&suppobject, &colobject, DEPENDENCY_INTERNAL);
...@@ -3637,7 +3638,7 @@ ATExecDropColumn(Relation rel, const char *colName, ...@@ -3637,7 +3638,7 @@ ATExecDropColumn(Relation rel, const char *colName,
/* /*
* Perform the actual column deletion * Perform the actual column deletion
*/ */
object.classId = RelOid_pg_class; object.classId = RelationRelationId;
object.objectId = RelationGetRelid(rel); object.objectId = RelationGetRelid(rel);
object.objectSubId = attnum; object.objectSubId = attnum;
...@@ -3697,6 +3698,7 @@ ATExecAddIndex(AlteredTableInfo *tab, Relation rel, ...@@ -3697,6 +3698,7 @@ ATExecAddIndex(AlteredTableInfo *tab, Relation rel,
DefineIndex(stmt->relation, /* relation */ DefineIndex(stmt->relation, /* relation */
stmt->idxname, /* index name */ stmt->idxname, /* index name */
InvalidOid, /* no predefined OID */
stmt->accessMethod, /* am name */ stmt->accessMethod, /* am name */
stmt->tableSpace, stmt->tableSpace,
stmt->indexParams, /* parameters */ stmt->indexParams, /* parameters */
...@@ -4894,7 +4896,7 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel, ...@@ -4894,7 +4896,7 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
ScanKeyInit(&key[0], ScanKeyInit(&key[0],
Anum_pg_depend_refclassid, Anum_pg_depend_refclassid,
BTEqualStrategyNumber, F_OIDEQ, BTEqualStrategyNumber, F_OIDEQ,
ObjectIdGetDatum(RelOid_pg_class)); ObjectIdGetDatum(RelationRelationId));
ScanKeyInit(&key[1], ScanKeyInit(&key[1],
Anum_pg_depend_refobjid, Anum_pg_depend_refobjid,
BTEqualStrategyNumber, F_OIDEQ, BTEqualStrategyNumber, F_OIDEQ,
...@@ -5018,7 +5020,7 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel, ...@@ -5018,7 +5020,7 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
ScanKeyInit(&key[0], ScanKeyInit(&key[0],
Anum_pg_depend_classid, Anum_pg_depend_classid,
BTEqualStrategyNumber, F_OIDEQ, BTEqualStrategyNumber, F_OIDEQ,
ObjectIdGetDatum(RelOid_pg_class)); ObjectIdGetDatum(RelationRelationId));
ScanKeyInit(&key[1], ScanKeyInit(&key[1],
Anum_pg_depend_objid, Anum_pg_depend_objid,
BTEqualStrategyNumber, F_OIDEQ, BTEqualStrategyNumber, F_OIDEQ,
...@@ -5038,7 +5040,7 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel, ...@@ -5038,7 +5040,7 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
if (foundDep->deptype != DEPENDENCY_NORMAL) if (foundDep->deptype != DEPENDENCY_NORMAL)
elog(ERROR, "found unexpected dependency type '%c'", elog(ERROR, "found unexpected dependency type '%c'",
foundDep->deptype); foundDep->deptype);
if (foundDep->refclassid != RelOid_pg_type || if (foundDep->refclassid != TypeRelationId ||
foundDep->refobjid != attTup->atttypid) foundDep->refobjid != attTup->atttypid)
elog(ERROR, "found unexpected dependency for column"); elog(ERROR, "found unexpected dependency for column");
...@@ -5143,7 +5145,7 @@ ATPostAlterTypeCleanup(List **wqueue, AlteredTableInfo *tab) ...@@ -5143,7 +5145,7 @@ ATPostAlterTypeCleanup(List **wqueue, AlteredTableInfo *tab)
performDeletion(&obj, DROP_RESTRICT); performDeletion(&obj, DROP_RESTRICT);
} }
obj.classId = RelOid_pg_class; obj.classId = RelationRelationId;
foreach(l, tab->changedIndexOids) foreach(l, tab->changedIndexOids)
{ {
obj.objectId = lfirst_oid(l); obj.objectId = lfirst_oid(l);
...@@ -5399,7 +5401,7 @@ change_owner_recurse_to_sequences(Oid relationOid, int32 newOwnerSysId) ...@@ -5399,7 +5401,7 @@ change_owner_recurse_to_sequences(Oid relationOid, int32 newOwnerSysId)
ScanKeyInit(&key[0], ScanKeyInit(&key[0],
Anum_pg_depend_refclassid, Anum_pg_depend_refclassid,
BTEqualStrategyNumber, F_OIDEQ, BTEqualStrategyNumber, F_OIDEQ,
ObjectIdGetDatum(RelOid_pg_class)); ObjectIdGetDatum(RelationRelationId));
ScanKeyInit(&key[1], ScanKeyInit(&key[1],
Anum_pg_depend_refobjid, Anum_pg_depend_refobjid,
BTEqualStrategyNumber, F_OIDEQ, BTEqualStrategyNumber, F_OIDEQ,
...@@ -5416,7 +5418,7 @@ change_owner_recurse_to_sequences(Oid relationOid, int32 newOwnerSysId) ...@@ -5416,7 +5418,7 @@ change_owner_recurse_to_sequences(Oid relationOid, int32 newOwnerSysId)
/* skip dependencies other than internal dependencies on columns */ /* skip dependencies other than internal dependencies on columns */
if (depForm->refobjsubid == 0 || if (depForm->refobjsubid == 0 ||
depForm->classid != RelOid_pg_class || depForm->classid != RelationRelationId ||
depForm->objsubid != 0 || depForm->objsubid != 0 ||
depForm->deptype != DEPENDENCY_INTERNAL) depForm->deptype != DEPENDENCY_INTERNAL)
continue; continue;
...@@ -5853,6 +5855,7 @@ AlterTableCreateToastTable(Oid relOid, bool silent) ...@@ -5853,6 +5855,7 @@ AlterTableCreateToastTable(Oid relOid, bool silent)
toast_relid = heap_create_with_catalog(toast_relname, toast_relid = heap_create_with_catalog(toast_relname,
PG_TOAST_NAMESPACE, PG_TOAST_NAMESPACE,
rel->rd_rel->reltablespace, rel->rd_rel->reltablespace,
InvalidOid,
tupdesc, tupdesc,
RELKIND_TOASTVALUE, RELKIND_TOASTVALUE,
shared_relation, shared_relation,
...@@ -5889,7 +5892,8 @@ AlterTableCreateToastTable(Oid relOid, bool silent) ...@@ -5889,7 +5892,8 @@ AlterTableCreateToastTable(Oid relOid, bool silent)
classObjectId[0] = OID_BTREE_OPS_OID; classObjectId[0] = OID_BTREE_OPS_OID;
classObjectId[1] = INT4_BTREE_OPS_OID; classObjectId[1] = INT4_BTREE_OPS_OID;
toast_idxid = index_create(toast_relid, toast_idxname, indexInfo, toast_idxid = index_create(toast_relid, toast_idxname, InvalidOid,
indexInfo,
BTREE_AM_OID, BTREE_AM_OID,
rel->rd_rel->reltablespace, rel->rd_rel->reltablespace,
classObjectId, classObjectId,
...@@ -5928,10 +5932,10 @@ AlterTableCreateToastTable(Oid relOid, bool silent) ...@@ -5928,10 +5932,10 @@ AlterTableCreateToastTable(Oid relOid, bool silent)
* Register dependency from the toast table to the master, so that the * Register dependency from the toast table to the master, so that the
* toast table will be deleted if the master is. * toast table will be deleted if the master is.
*/ */
baseobject.classId = RelOid_pg_class; baseobject.classId = RelationRelationId;
baseobject.objectId = relOid; baseobject.objectId = relOid;
baseobject.objectSubId = 0; baseobject.objectSubId = 0;
toastobject.classId = RelOid_pg_class; toastobject.classId = RelationRelationId;
toastobject.objectId = toast_relid; toastobject.objectId = toast_relid;
toastobject.objectSubId = 0; toastobject.objectSubId = 0;
...@@ -6091,7 +6095,7 @@ PreCommit_on_commit_actions(void) ...@@ -6091,7 +6095,7 @@ PreCommit_on_commit_actions(void)
{ {
ObjectAddress object; ObjectAddress object;
object.classId = RelOid_pg_class; object.classId = RelationRelationId;
object.objectId = oc->relid; object.objectId = oc->relid;
object.objectSubId = 0; object.objectSubId = 0;
performDeletion(&object, DROP_CASCADE); performDeletion(&object, DROP_CASCADE);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/trigger.c,v 1.184 2005/04/11 19:51:15 tgl Exp $ * $PostgreSQL: pgsql/src/backend/commands/trigger.c,v 1.185 2005/04/14 01:38:17 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -422,20 +422,20 @@ CreateTrigger(CreateTrigStmt *stmt, bool forConstraint) ...@@ -422,20 +422,20 @@ CreateTrigger(CreateTrigStmt *stmt, bool forConstraint)
* dependency on the constraint will indirectly depend on the * dependency on the constraint will indirectly depend on the
* relations. * relations.
*/ */
referenced.classId = RelOid_pg_proc; referenced.classId = ProcedureRelationId;
referenced.objectId = funcoid; referenced.objectId = funcoid;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
if (!forConstraint) if (!forConstraint)
{ {
referenced.classId = RelOid_pg_class; referenced.classId = RelationRelationId;
referenced.objectId = RelationGetRelid(rel); referenced.objectId = RelationGetRelid(rel);
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_AUTO); recordDependencyOn(&myself, &referenced, DEPENDENCY_AUTO);
if (constrrelid != InvalidOid) if (constrrelid != InvalidOid)
{ {
referenced.classId = RelOid_pg_class; referenced.classId = RelationRelationId;
referenced.objectId = constrrelid; referenced.objectId = constrrelid;
referenced.objectSubId = 0; referenced.objectSubId = 0;
recordDependencyOn(&myself, &referenced, DEPENDENCY_AUTO); recordDependencyOn(&myself, &referenced, DEPENDENCY_AUTO);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/typecmds.c,v 1.68 2005/03/29 03:01:30 tgl Exp $ * $PostgreSQL: pgsql/src/backend/commands/typecmds.c,v 1.69 2005/04/14 01:38:17 tgl Exp $
* *
* DESCRIPTION * DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the * The "DefineFoo" routines take the parse tree and pick out the
...@@ -441,7 +441,7 @@ RemoveType(List *names, DropBehavior behavior) ...@@ -441,7 +441,7 @@ RemoveType(List *names, DropBehavior behavior)
/* /*
* Do the deletion * Do the deletion
*/ */
object.classId = RelOid_pg_type; object.classId = TypeRelationId;
object.objectId = typeoid; object.objectId = typeoid;
object.objectSubId = 0; object.objectSubId = 0;
...@@ -836,7 +836,7 @@ RemoveDomain(List *names, DropBehavior behavior) ...@@ -836,7 +836,7 @@ RemoveDomain(List *names, DropBehavior behavior)
/* /*
* Do the deletion * Do the deletion
*/ */
object.classId = RelOid_pg_type; object.classId = TypeRelationId;
object.objectId = typeoid; object.objectId = typeoid;
object.objectSubId = 0; object.objectSubId = 0;
...@@ -1655,7 +1655,7 @@ get_rels_with_domain(Oid domainOid, LOCKMODE lockmode) ...@@ -1655,7 +1655,7 @@ get_rels_with_domain(Oid domainOid, LOCKMODE lockmode)
ScanKeyInit(&key[0], ScanKeyInit(&key[0],
Anum_pg_depend_refclassid, Anum_pg_depend_refclassid,
BTEqualStrategyNumber, F_OIDEQ, BTEqualStrategyNumber, F_OIDEQ,
ObjectIdGetDatum(RelOid_pg_type)); ObjectIdGetDatum(TypeRelationId));
ScanKeyInit(&key[1], ScanKeyInit(&key[1],
Anum_pg_depend_refobjid, Anum_pg_depend_refobjid,
BTEqualStrategyNumber, F_OIDEQ, BTEqualStrategyNumber, F_OIDEQ,
...@@ -1674,7 +1674,7 @@ get_rels_with_domain(Oid domainOid, LOCKMODE lockmode) ...@@ -1674,7 +1674,7 @@ get_rels_with_domain(Oid domainOid, LOCKMODE lockmode)
/* Ignore dependees that aren't user columns of relations */ /* Ignore dependees that aren't user columns of relations */
/* (we assume system columns are never of domain types) */ /* (we assume system columns are never of domain types) */
if (pg_depend->classid != RelOid_pg_class || if (pg_depend->classid != RelationRelationId ||
pg_depend->objsubid <= 0) pg_depend->objsubid <= 0)
continue; continue;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/backend/commands/user.c,v 1.149 2005/02/20 02:21:34 tgl Exp $ * $PostgreSQL: pgsql/src/backend/commands/user.c,v 1.150 2005/04/14 01:38:17 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -813,10 +813,10 @@ CheckPgUserAclNotNull(void) ...@@ -813,10 +813,10 @@ CheckPgUserAclNotNull(void)
HeapTuple htup; HeapTuple htup;
htup = SearchSysCache(RELOID, htup = SearchSysCache(RELOID,
ObjectIdGetDatum(RelOid_pg_shadow), ObjectIdGetDatum(ShadowRelationId),
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(htup)) /* should not happen, we hope */ if (!HeapTupleIsValid(htup)) /* should not happen, we hope */
elog(ERROR, "cache lookup failed for relation %u", RelOid_pg_shadow); elog(ERROR, "cache lookup failed for relation %u", ShadowRelationId);
if (heap_attisnull(htup, Anum_pg_class_relacl)) if (heap_attisnull(htup, Anum_pg_class_relacl))
ereport(ERROR, ereport(ERROR,
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/view.c,v 1.89 2005/04/13 16:50:54 tgl Exp $ * $PostgreSQL: pgsql/src/backend/commands/view.c,v 1.90 2005/04/14 01:38:17 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -448,7 +448,7 @@ RemoveView(const RangeVar *view, DropBehavior behavior) ...@@ -448,7 +448,7 @@ RemoveView(const RangeVar *view, DropBehavior behavior)
viewOid = RangeVarGetRelid(view, false); viewOid = RangeVarGetRelid(view, false);
object.classId = RelOid_pg_class; object.classId = RelationRelationId;
object.objectId = viewOid; object.objectId = viewOid;
object.objectSubId = 0; object.objectSubId = 0;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.245 2005/04/06 16:34:04 tgl Exp $ * $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.246 2005/04/14 01:38:17 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -759,6 +759,7 @@ InitPlan(QueryDesc *queryDesc, bool explainOnly) ...@@ -759,6 +759,7 @@ InitPlan(QueryDesc *queryDesc, bool explainOnly)
intoRelationId = heap_create_with_catalog(intoName, intoRelationId = heap_create_with_catalog(intoName,
namespaceId, namespaceId,
InvalidOid, InvalidOid,
InvalidOid,
tupdesc, tupdesc,
RELKIND_RELATION, RELKIND_RELATION,
false, false,
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/rewrite/rewriteDefine.c,v 1.102 2005/04/06 16:34:06 tgl Exp $ * $PostgreSQL: pgsql/src/backend/rewrite/rewriteDefine.c,v 1.103 2005/04/14 01:38:17 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -148,11 +148,11 @@ InsertRule(char *rulname, ...@@ -148,11 +148,11 @@ InsertRule(char *rulname,
* implicit --- this prevents deleting a view's SELECT rule. Other * implicit --- this prevents deleting a view's SELECT rule. Other
* kinds of rules can be AUTO. * kinds of rules can be AUTO.
*/ */
myself.classId = RelationGetRelid(pg_rewrite_desc); myself.classId = RewriteRelationId;
myself.objectId = rewriteObjectId; myself.objectId = rewriteObjectId;
myself.objectSubId = 0; myself.objectSubId = 0;
referenced.classId = RelOid_pg_class; referenced.classId = RelationRelationId;
referenced.objectId = eventrel_oid; referenced.objectId = eventrel_oid;
referenced.objectSubId = 0; referenced.objectSubId = 0;
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/tcop/utility.c,v 1.234 2005/03/14 00:19:36 neilc Exp $ * $PostgreSQL: pgsql/src/backend/tcop/utility.c,v 1.235 2005/04/14 01:38:18 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -724,6 +724,7 @@ ProcessUtility(Node *parsetree, ...@@ -724,6 +724,7 @@ ProcessUtility(Node *parsetree,
DefineIndex(stmt->relation, /* relation */ DefineIndex(stmt->relation, /* relation */
stmt->idxname, /* index name */ stmt->idxname, /* index name */
InvalidOid, /* no predefined OID */
stmt->accessMethod, /* am name */ stmt->accessMethod, /* am name */
stmt->tableSpace, stmt->tableSpace,
stmt->indexParams, /* parameters */ stmt->indexParams, /* parameters */
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* back to source text * back to source text
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.191 2005/04/07 01:51:39 neilc Exp $ * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.192 2005/04/14 01:38:19 tgl Exp $
* *
* This software is copyrighted by Jan Wieck - Hamburg. * This software is copyrighted by Jan Wieck - Hamburg.
* *
...@@ -1274,7 +1274,7 @@ pg_get_serial_sequence(PG_FUNCTION_ARGS) ...@@ -1274,7 +1274,7 @@ pg_get_serial_sequence(PG_FUNCTION_ARGS)
ScanKeyInit(&key[0], ScanKeyInit(&key[0],
Anum_pg_depend_refclassid, Anum_pg_depend_refclassid,
BTEqualStrategyNumber, F_OIDEQ, BTEqualStrategyNumber, F_OIDEQ,
ObjectIdGetDatum(RelOid_pg_class)); ObjectIdGetDatum(RelationRelationId));
ScanKeyInit(&key[1], ScanKeyInit(&key[1],
Anum_pg_depend_refobjid, Anum_pg_depend_refobjid,
BTEqualStrategyNumber, F_OIDEQ, BTEqualStrategyNumber, F_OIDEQ,
...@@ -1295,7 +1295,7 @@ pg_get_serial_sequence(PG_FUNCTION_ARGS) ...@@ -1295,7 +1295,7 @@ pg_get_serial_sequence(PG_FUNCTION_ARGS)
* We assume any internal dependency of a relation on a column * We assume any internal dependency of a relation on a column
* must be what we are looking for. * must be what we are looking for.
*/ */
if (deprec->classid == RelOid_pg_class && if (deprec->classid == RelationRelationId &&
deprec->objsubid == 0 && deprec->objsubid == 0 &&
deprec->deptype == DEPENDENCY_INTERNAL) deprec->deptype == DEPENDENCY_INTERNAL)
{ {
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/cache/inval.c,v 1.70 2005/01/10 21:57:17 tgl Exp $ * $PostgreSQL: pgsql/src/backend/utils/cache/inval.c,v 1.71 2005/04/14 01:38:19 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -541,7 +541,7 @@ PrepareForTupleInvalidation(Relation relation, HeapTuple tuple) ...@@ -541,7 +541,7 @@ PrepareForTupleInvalidation(Relation relation, HeapTuple tuple)
*/ */
tupleRelId = RelationGetRelid(relation); tupleRelId = RelationGetRelid(relation);
if (tupleRelId == RelOid_pg_class) if (tupleRelId == RelationRelationId)
{ {
Form_pg_class classtup = (Form_pg_class) GETSTRUCT(tuple); Form_pg_class classtup = (Form_pg_class) GETSTRUCT(tuple);
RelFileNode rnode; RelFileNode rnode;
...@@ -575,7 +575,7 @@ PrepareForTupleInvalidation(Relation relation, HeapTuple tuple) ...@@ -575,7 +575,7 @@ PrepareForTupleInvalidation(Relation relation, HeapTuple tuple)
rnode.relNode = classtup->relfilenode; rnode.relNode = classtup->relfilenode;
RegisterSmgrInvalidation(rnode); RegisterSmgrInvalidation(rnode);
} }
else if (tupleRelId == RelOid_pg_attribute) else if (tupleRelId == AttributeRelationId)
{ {
Form_pg_attribute atttup = (Form_pg_attribute) GETSTRUCT(tuple); Form_pg_attribute atttup = (Form_pg_attribute) GETSTRUCT(tuple);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.218 2005/03/29 00:17:11 tgl Exp $ * $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.219 2005/04/14 01:38:19 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -2150,17 +2150,35 @@ RelationBuildLocalRelation(const char *relname, ...@@ -2150,17 +2150,35 @@ RelationBuildLocalRelation(const char *relname,
TupleDesc tupDesc, TupleDesc tupDesc,
Oid relid, Oid relid,
Oid reltablespace, Oid reltablespace,
bool shared_relation, bool shared_relation)
bool nailit)
{ {
Relation rel; Relation rel;
MemoryContext oldcxt; MemoryContext oldcxt;
int natts = tupDesc->natts; int natts = tupDesc->natts;
int i; int i;
bool has_not_null; bool has_not_null;
bool nailit;
AssertArg(natts >= 0); AssertArg(natts >= 0);
/*
* check for creation of a rel that must be nailed in cache.
*
* XXX this list had better match RelationCacheInitialize's list.
*/
switch (relid)
{
case RelationRelationId:
case AttributeRelationId:
case ProcedureRelationId:
case TypeRelationId:
nailit = true;
break;
default:
nailit = false;
break;
}
/* /*
* switch to the cache context to create the relcache entry. * switch to the cache context to create the relcache entry.
*/ */
...@@ -2179,6 +2197,9 @@ RelationBuildLocalRelation(const char *relname, ...@@ -2179,6 +2197,9 @@ RelationBuildLocalRelation(const char *relname,
/* make sure relation is marked as having no open file yet */ /* make sure relation is marked as having no open file yet */
rel->rd_smgr = NULL; rel->rd_smgr = NULL;
/* mark it nailed if appropriate */
rel->rd_isnailed = nailit;
rel->rd_refcnt = nailit ? 1 : 0; rel->rd_refcnt = nailit ? 1 : 0;
/* it's being created in this transaction */ /* it's being created in this transaction */
...@@ -2190,14 +2211,6 @@ RelationBuildLocalRelation(const char *relname, ...@@ -2190,14 +2211,6 @@ RelationBuildLocalRelation(const char *relname,
/* is it a temporary relation? */ /* is it a temporary relation? */
rel->rd_istemp = isTempNamespace(relnamespace); rel->rd_istemp = isTempNamespace(relnamespace);
/*
* nail the reldesc if this is a bootstrap create reln and we may need
* it in the cache later on in the bootstrap process so we don't ever
* want it kicked out. e.g. pg_attribute!!!
*/
if (nailit)
rel->rd_isnailed = true;
/* /*
* create a new tuple descriptor from the one passed in. We do this * create a new tuple descriptor from the one passed in. We do this
* partly to copy it into the cache context, and partly because the * partly to copy it into the cache context, and partly because the
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/backend/utils/init/flatfiles.c,v 1.4 2005/02/26 18:43:33 tgl Exp $ * $PostgreSQL: pgsql/src/backend/utils/init/flatfiles.c,v 1.5 2005/04/14 01:38:20 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -643,7 +643,7 @@ BuildFlatFiles(bool database_only) ...@@ -643,7 +643,7 @@ BuildFlatFiles(bool database_only)
/* hard-wired path to pg_database */ /* hard-wired path to pg_database */
rnode.spcNode = GLOBALTABLESPACE_OID; rnode.spcNode = GLOBALTABLESPACE_OID;
rnode.dbNode = 0; rnode.dbNode = 0;
rnode.relNode = RelOid_pg_database; rnode.relNode = DatabaseRelationId;
/* No locking is needed because no one else is alive yet */ /* No locking is needed because no one else is alive yet */
rel = XLogOpenRelation(true, 0, rnode); rel = XLogOpenRelation(true, 0, rnode);
...@@ -654,7 +654,7 @@ BuildFlatFiles(bool database_only) ...@@ -654,7 +654,7 @@ BuildFlatFiles(bool database_only)
/* hard-wired path to pg_group */ /* hard-wired path to pg_group */
rnode.spcNode = GLOBALTABLESPACE_OID; rnode.spcNode = GLOBALTABLESPACE_OID;
rnode.dbNode = 0; rnode.dbNode = 0;
rnode.relNode = RelOid_pg_group; rnode.relNode = GroupRelationId;
rel = XLogOpenRelation(true, 0, rnode); rel = XLogOpenRelation(true, 0, rnode);
write_group_file(rel); write_group_file(rel);
...@@ -662,7 +662,7 @@ BuildFlatFiles(bool database_only) ...@@ -662,7 +662,7 @@ BuildFlatFiles(bool database_only)
/* hard-wired path to pg_shadow */ /* hard-wired path to pg_shadow */
rnode.spcNode = GLOBALTABLESPACE_OID; rnode.spcNode = GLOBALTABLESPACE_OID;
rnode.dbNode = 0; rnode.dbNode = 0;
rnode.relNode = RelOid_pg_shadow; rnode.relNode = ShadowRelationId;
rel = XLogOpenRelation(true, 0, rnode); rel = XLogOpenRelation(true, 0, rnode);
write_user_file(rel); write_user_file(rel);
...@@ -816,13 +816,13 @@ flatfile_update_trigger(PG_FUNCTION_ARGS) ...@@ -816,13 +816,13 @@ flatfile_update_trigger(PG_FUNCTION_ARGS)
switch (RelationGetRelid(trigdata->tg_relation)) switch (RelationGetRelid(trigdata->tg_relation))
{ {
case RelOid_pg_database: case DatabaseRelationId:
database_file_update_needed(); database_file_update_needed();
break; break;
case RelOid_pg_group: case GroupRelationId:
group_file_update_needed(); group_file_update_needed();
break; break;
case RelOid_pg_shadow: case ShadowRelationId:
user_file_update_needed(); user_file_update_needed();
break; break;
default: default:
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/catname.h,v 1.34 2004/12/31 22:03:24 pgsql Exp $ * $PostgreSQL: pgsql/src/include/catalog/catname.h,v 1.35 2005/04/14 01:38:20 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
#define StatisticRelationName "pg_statistic" #define StatisticRelationName "pg_statistic"
#define TableSpaceRelationName "pg_tablespace" #define TableSpaceRelationName "pg_tablespace"
#define TypeRelationName "pg_type" #define TypeRelationName "pg_type"
#define VersionRelationName "pg_version"
#define AttrDefaultRelationName "pg_attrdef" #define AttrDefaultRelationName "pg_attrdef"
#define TriggerRelationName "pg_trigger" #define TriggerRelationName "pg_trigger"
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.264 2005/04/12 04:26:28 tgl Exp $ * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.265 2005/04/14 01:38:20 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -53,6 +53,6 @@ ...@@ -53,6 +53,6 @@
*/ */
/* yyyymmddN */ /* yyyymmddN */
#define CATALOG_VERSION_NO 200504111 #define CATALOG_VERSION_NO 200504131
#endif #endif
...@@ -2,18 +2,23 @@ ...@@ -2,18 +2,23 @@
# #
# duplicate_oids # duplicate_oids
# #
# $PostgreSQL: pgsql/src/include/catalog/duplicate_oids,v 1.6 2005/04/13 18:54:57 tgl Exp $ # $PostgreSQL: pgsql/src/include/catalog/duplicate_oids,v 1.7 2005/04/14 01:38:20 tgl Exp $
# #
# finds manually-assigned oids that are duplicated in the system tables. # finds manually-assigned oids that are duplicated in the system tables.
# #
# run this script in src/include/catalog. # run this script in src/include/catalog.
# #
FILES=`ls pg_*.h` # note: we exclude BKI_BOOTSTRAP relations since they are expected to have
# matching DATA lines in pg_class.h
egrep '^DATA' $FILES | \ cat pg_*.h indexing.h | \
sed -e 's/^.*OID[^=]*=[^0-9]*//' -e 's/[^0-9].*$//' | \ egrep -v -e '^CATALOG\(.*BKI_BOOTSTRAP' | \
sort -n | uniq -d | \ sed -n -e 's/^DATA(insert *OID *= *\([0-9][0-9]*\).*$/\1/p' \
egrep -v '^0*$' -e 's/^CATALOG([^,]*, *\([0-9][0-9]*\).*$/\1/p' \
-e 's/^DECLARE_INDEX([^,]*, *\([0-9][0-9]*\).*$/\1/p' \
-e 's/^DECLARE_UNIQUE_INDEX([^,]*, *\([0-9][0-9]*\).*$/\1/p' | \
sort -n | \
uniq -d
exit 0 exit 0
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/heap.h,v 1.73 2005/01/27 03:18:15 tgl Exp $ * $PostgreSQL: pgsql/src/include/catalog/heap.h,v 1.74 2005/04/14 01:38:20 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -38,6 +38,7 @@ typedef struct CookedConstraint ...@@ -38,6 +38,7 @@ typedef struct CookedConstraint
extern Relation heap_create(const char *relname, extern Relation heap_create(const char *relname,
Oid relnamespace, Oid relnamespace,
Oid reltablespace, Oid reltablespace,
Oid relid,
TupleDesc tupDesc, TupleDesc tupDesc,
char relkind, char relkind,
bool shared_relation, bool shared_relation,
...@@ -46,6 +47,7 @@ extern Relation heap_create(const char *relname, ...@@ -46,6 +47,7 @@ extern Relation heap_create(const char *relname,
extern Oid heap_create_with_catalog(const char *relname, extern Oid heap_create_with_catalog(const char *relname,
Oid relnamespace, Oid relnamespace,
Oid reltablespace, Oid reltablespace,
Oid relid,
TupleDesc tupdesc, TupleDesc tupdesc,
char relkind, char relkind,
bool shared_relation, bool shared_relation,
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/index.h,v 1.61 2005/03/21 01:24:04 tgl Exp $ * $PostgreSQL: pgsql/src/include/catalog/index.h,v 1.62 2005/04/14 01:38:20 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -32,6 +32,7 @@ typedef void (*IndexBuildCallback) (Relation index, ...@@ -32,6 +32,7 @@ typedef void (*IndexBuildCallback) (Relation index,
extern Oid index_create(Oid heapRelationId, extern Oid index_create(Oid heapRelationId,
const char *indexRelationName, const char *indexRelationName,
Oid indexRelationId,
IndexInfo *indexInfo, IndexInfo *indexInfo,
Oid accessMethodObjectId, Oid accessMethodObjectId,
Oid tableSpaceId, Oid tableSpaceId,
......
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_aggregate.h,v 1.50 2005/04/12 04:26:28 tgl Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_aggregate.h,v 1.51 2005/04/14 01:38:20 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
/* ---------------- /* ----------------
* postgres.h contains the system type definitions and the * postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler. * can be read by both genbki.sh and the C compiler.
* ---------------- * ----------------
*/ */
...@@ -41,7 +41,9 @@ ...@@ -41,7 +41,9 @@
* agginitval initial value for transition state (can be NULL) * agginitval initial value for transition state (can be NULL)
* ---------------------------------------------------------------- * ----------------------------------------------------------------
*/ */
CATALOG(pg_aggregate) BKI_WITHOUT_OIDS #define AggregateRelationId 2600
CATALOG(pg_aggregate,2600) BKI_WITHOUT_OIDS
{ {
regproc aggfnoid; regproc aggfnoid;
regproc aggtransfn; regproc aggtransfn;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_am.h,v 1.32 2005/03/27 23:53:05 tgl Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_am.h,v 1.33 2005/04/14 01:38:20 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
/* ---------------- /* ----------------
* postgres.h contains the system type definitions and the * postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler. * can be read by both genbki.sh and the C compiler.
* ---------------- * ----------------
*/ */
...@@ -34,7 +34,9 @@ ...@@ -34,7 +34,9 @@
* typedef struct FormData_pg_am * typedef struct FormData_pg_am
* ---------------- * ----------------
*/ */
CATALOG(pg_am) #define AccessMethodRelationId 2601
CATALOG(pg_am,2601)
{ {
NameData amname; /* access method name */ NameData amname; /* access method name */
int2 amstrategies; /* total NUMBER of strategies (operators) int2 amstrategies; /* total NUMBER of strategies (operators)
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_amop.h,v 1.62 2004/12/31 22:03:24 pgsql Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_amop.h,v 1.63 2005/04/14 01:38:20 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
/* ---------------- /* ----------------
* postgres.h contains the system type definitions and the * postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler. * can be read by both genbki.sh and the C compiler.
* ---------------- * ----------------
*/ */
...@@ -46,7 +46,9 @@ ...@@ -46,7 +46,9 @@
* typedef struct FormData_pg_amop * typedef struct FormData_pg_amop
* ---------------- * ----------------
*/ */
CATALOG(pg_amop) BKI_WITHOUT_OIDS #define AccessMethodOperatorRelationId 2602
CATALOG(pg_amop,2602) BKI_WITHOUT_OIDS
{ {
Oid amopclaid; /* the index opclass this entry is for */ Oid amopclaid; /* the index opclass this entry is for */
Oid amopsubtype; /* operator subtype, or zero if default */ Oid amopsubtype; /* operator subtype, or zero if default */
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_amproc.h,v 1.52 2004/12/31 22:03:24 pgsql Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_amproc.h,v 1.53 2005/04/14 01:38:20 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
/* ---------------- /* ----------------
* postgres.h contains the system type definitions and the * postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler. * can be read by both genbki.sh and the C compiler.
* ---------------- * ----------------
*/ */
...@@ -42,7 +42,9 @@ ...@@ -42,7 +42,9 @@
* typedef struct FormData_pg_amproc * typedef struct FormData_pg_amproc
* ---------------- * ----------------
*/ */
CATALOG(pg_amproc) BKI_WITHOUT_OIDS #define AccessMethodProcedureRelationId 2603
CATALOG(pg_amproc,2603) BKI_WITHOUT_OIDS
{ {
Oid amopclaid; /* the index opclass this entry is for */ Oid amopclaid; /* the index opclass this entry is for */
Oid amprocsubtype; /* procedure subtype, or zero if default */ Oid amprocsubtype; /* procedure subtype, or zero if default */
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_attrdef.h,v 1.18 2004/12/31 22:03:24 pgsql Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_attrdef.h,v 1.19 2005/04/14 01:38:20 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/* ---------------- /* ----------------
* postgres.h contains the system type definitions and the * postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler. * can be read by both genbki.sh and the C compiler.
* ---------------- * ----------------
*/ */
...@@ -31,7 +31,9 @@ ...@@ -31,7 +31,9 @@
* typedef struct FormData_pg_attrdef * typedef struct FormData_pg_attrdef
* ---------------- * ----------------
*/ */
CATALOG(pg_attrdef) #define AttrDefaultRelationId 2604
CATALOG(pg_attrdef,2604)
{ {
Oid adrelid; Oid adrelid;
int2 adnum; int2 adnum;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_attribute.h,v 1.115 2005/03/29 19:44:23 tgl Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_attribute.h,v 1.116 2005/04/14 01:38:20 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
/* ---------------- /* ----------------
* postgres.h contains the system type definitions and the * postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler. * can be read by both genbki.sh and the C compiler.
* ---------------- * ----------------
*/ */
...@@ -39,7 +39,9 @@ ...@@ -39,7 +39,9 @@
* system attributes in catalog/heap.c also. * system attributes in catalog/heap.c also.
* ---------------- * ----------------
*/ */
CATALOG(pg_attribute) BOOTSTRAP BKI_WITHOUT_OIDS #define AttributeRelationId 1249
CATALOG(pg_attribute,1249) BKI_BOOTSTRAP BKI_WITHOUT_OIDS
{ {
Oid attrelid; /* OID of relation containing this Oid attrelid; /* OID of relation containing this
* attribute */ * attribute */
...@@ -246,7 +248,6 @@ typedef FormData_pg_attribute *Form_pg_attribute; ...@@ -246,7 +248,6 @@ typedef FormData_pg_attribute *Form_pg_attribute;
{ 1247, {"typdefaultbin"}, 25, -1, -1, 22, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0 }, \ { 1247, {"typdefaultbin"}, 25, -1, -1, 22, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0 }, \
{ 1247, {"typdefault"}, 25, -1, -1, 23, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0 } { 1247, {"typdefault"}, 25, -1, -1, 23, 0, -1, -1, false, 'x', 'i', false, false, false, true, 0 }
DATA(insert ( 1247 typname 19 -1 NAMEDATALEN 1 0 -1 -1 f p i t f f t 0)); DATA(insert ( 1247 typname 19 -1 NAMEDATALEN 1 0 -1 -1 f p i t f f t 0));
DATA(insert ( 1247 typnamespace 26 -1 4 2 0 -1 -1 t p i t f f t 0)); DATA(insert ( 1247 typnamespace 26 -1 4 2 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1247 typowner 23 -1 4 3 0 -1 -1 t p i t f f t 0)); DATA(insert ( 1247 typowner 23 -1 4 3 0 -1 -1 t p i t f f t 0));
...@@ -278,29 +279,6 @@ DATA(insert ( 1247 xmax 28 0 4 -5 0 -1 -1 t p i t f f t 0)); ...@@ -278,29 +279,6 @@ DATA(insert ( 1247 xmax 28 0 4 -5 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1247 cmax 29 0 4 -6 0 -1 -1 t p i t f f t 0)); DATA(insert ( 1247 cmax 29 0 4 -6 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1247 tableoid 26 0 4 -7 0 -1 -1 t p i t f f t 0)); DATA(insert ( 1247 tableoid 26 0 4 -7 0 -1 -1 t p i t f f t 0));
/* ----------------
* pg_database
* ----------------
*/
DATA(insert ( 1262 datname 19 -1 NAMEDATALEN 1 0 -1 -1 f p i t f f t 0));
DATA(insert ( 1262 datdba 23 -1 4 2 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1262 encoding 23 -1 4 3 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1262 datistemplate 16 -1 1 4 0 -1 -1 t p c t f f t 0));
DATA(insert ( 1262 datallowconn 16 -1 1 5 0 -1 -1 t p c t f f t 0));
DATA(insert ( 1262 datlastsysoid 26 -1 4 6 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1262 datvacuumxid 28 -1 4 7 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1262 datfrozenxid 28 -1 4 8 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1262 dattablespace 26 -1 4 9 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1262 datconfig 1009 -1 -1 10 1 -1 -1 f x i f f f t 0));
DATA(insert ( 1262 datacl 1034 -1 -1 11 1 -1 -1 f x i f f f t 0));
DATA(insert ( 1262 ctid 27 0 6 -1 0 -1 -1 f p s t f f t 0));
DATA(insert ( 1262 oid 26 0 4 -2 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1262 xmin 28 0 4 -3 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1262 cmin 29 0 4 -4 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1262 xmax 28 0 4 -5 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1262 cmax 29 0 4 -6 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1262 tableoid 26 0 4 -7 0 -1 -1 t p i t f f t 0));
/* ---------------- /* ----------------
* pg_proc * pg_proc
* ---------------- * ----------------
...@@ -351,41 +329,6 @@ DATA(insert ( 1255 xmax 28 0 4 -5 0 -1 -1 t p i t f f t 0)); ...@@ -351,41 +329,6 @@ DATA(insert ( 1255 xmax 28 0 4 -5 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1255 cmax 29 0 4 -6 0 -1 -1 t p i t f f t 0)); DATA(insert ( 1255 cmax 29 0 4 -6 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1255 tableoid 26 0 4 -7 0 -1 -1 t p i t f f t 0)); DATA(insert ( 1255 tableoid 26 0 4 -7 0 -1 -1 t p i t f f t 0));
/* ----------------
* pg_shadow
* ----------------
*/
DATA(insert ( 1260 usename 19 -1 NAMEDATALEN 1 0 -1 -1 f p i t f f t 0));
DATA(insert ( 1260 usesysid 23 -1 4 2 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1260 usecreatedb 16 -1 1 3 0 -1 -1 t p c t f f t 0));
DATA(insert ( 1260 usesuper 16 -1 1 4 0 -1 -1 t p c t f f t 0));
DATA(insert ( 1260 usecatupd 16 -1 1 5 0 -1 -1 t p c t f f t 0));
DATA(insert ( 1260 passwd 25 -1 -1 6 0 -1 -1 f x i f f f t 0));
DATA(insert ( 1260 valuntil 702 -1 4 7 0 -1 -1 t p i f f f t 0));
DATA(insert ( 1260 useconfig 1009 -1 -1 8 1 -1 -1 f x i f f f t 0));
DATA(insert ( 1260 ctid 27 0 6 -1 0 -1 -1 f p s t f f t 0));
/* no OIDs in pg_shadow */
DATA(insert ( 1260 xmin 28 0 4 -3 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1260 cmin 29 0 4 -4 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1260 xmax 28 0 4 -5 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1260 cmax 29 0 4 -6 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1260 tableoid 26 0 4 -7 0 -1 -1 t p i t f f t 0));
/* ----------------
* pg_group
* ----------------
*/
DATA(insert ( 1261 groname 19 -1 NAMEDATALEN 1 0 -1 -1 f p i t f f t 0));
DATA(insert ( 1261 grosysid 23 -1 4 2 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1261 grolist 1007 -1 -1 3 1 -1 -1 f x i f f f t 0));
DATA(insert ( 1261 ctid 27 0 6 -1 0 -1 -1 f p s t f f t 0));
/* no OIDs in pg_group */
DATA(insert ( 1261 xmin 28 0 4 -3 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1261 cmin 29 0 4 -4 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1261 xmax 28 0 4 -5 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1261 cmax 29 0 4 -6 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1261 tableoid 26 0 4 -7 0 -1 -1 t p i t f f t 0));
/* ---------------- /* ----------------
* pg_attribute * pg_attribute
* ---------------- * ----------------
...@@ -498,23 +441,6 @@ DATA(insert ( 1259 xmax 28 0 4 -5 0 -1 -1 t p i t f f t 0)); ...@@ -498,23 +441,6 @@ DATA(insert ( 1259 xmax 28 0 4 -5 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1259 cmax 29 0 4 -6 0 -1 -1 t p i t f f t 0)); DATA(insert ( 1259 cmax 29 0 4 -6 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1259 tableoid 26 0 4 -7 0 -1 -1 t p i t f f t 0)); DATA(insert ( 1259 tableoid 26 0 4 -7 0 -1 -1 t p i t f f t 0));
/* ----------------
* pg_tablespace
* ----------------
*/
DATA(insert ( 1213 spcname 19 -1 NAMEDATALEN 1 0 -1 -1 f p i t f f t 0));
DATA(insert ( 1213 spcowner 23 -1 4 2 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1213 spclocation 25 -1 -1 3 0 -1 -1 f x i t f f t 0));
DATA(insert ( 1213 spcacl 1034 -1 -1 4 1 -1 -1 f x i f f f t 0));
DATA(insert ( 1213 ctid 27 0 6 -1 0 -1 -1 f p s t f f t 0));
DATA(insert ( 1213 oid 26 0 4 -2 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1213 xmin 28 0 4 -3 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1213 cmin 29 0 4 -4 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1213 xmax 28 0 4 -5 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1213 cmax 29 0 4 -6 0 -1 -1 t p i t f f t 0));
DATA(insert ( 1213 tableoid 26 0 4 -7 0 -1 -1 t p i t f f t 0));
/* ---------------- /* ----------------
* pg_index * pg_index
* *
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* Copyright (c) 2002-2005, PostgreSQL Global Development Group * Copyright (c) 2002-2005, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_cast.h,v 1.20 2005/04/13 16:15:35 tgl Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_cast.h,v 1.21 2005/04/14 01:38:20 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -21,7 +21,9 @@ ...@@ -21,7 +21,9 @@
#ifndef PG_CAST_H #ifndef PG_CAST_H
#define PG_CAST_H #define PG_CAST_H
CATALOG(pg_cast) #define CastRelationId 2605
CATALOG(pg_cast,2605)
{ {
Oid castsource; /* source datatype for cast */ Oid castsource; /* source datatype for cast */
Oid casttarget; /* destination datatype for cast */ Oid casttarget; /* destination datatype for cast */
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_class.h,v 1.86 2005/03/29 19:44:23 tgl Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_class.h,v 1.87 2005/04/14 01:38:20 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/* ---------------- /* ----------------
* postgres.h contains the system type definitions and the * postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler. * can be read by both genbki.sh and the C compiler.
* ---------------- * ----------------
*/ */
...@@ -40,7 +40,9 @@ ...@@ -40,7 +40,9 @@
* to get the relacl field ... and don't forget to check isNull. * to get the relacl field ... and don't forget to check isNull.
* ---------------- * ----------------
*/ */
CATALOG(pg_class) BOOTSTRAP #define RelationRelationId 1259
CATALOG(pg_class,1259) BKI_BOOTSTRAP
{ {
NameData relname; /* class name */ NameData relname; /* class name */
Oid relnamespace; /* OID of namespace containing this class */ Oid relnamespace; /* OID of namespace containing this class */
...@@ -132,7 +134,8 @@ typedef FormData_pg_class *Form_pg_class; ...@@ -132,7 +134,8 @@ typedef FormData_pg_class *Form_pg_class;
/* ---------------- /* ----------------
* initial contents of pg_class * initial contents of pg_class
* *
* NOTE: only "bootstrapped" relations need to be declared here. * NOTE: only "bootstrapped" relations need to be declared here. Be sure that
* the OIDs listed here match those given in their CATALOG macros.
* ---------------- * ----------------
*/ */
...@@ -144,26 +147,9 @@ DATA(insert OID = 1255 ( pg_proc PGNSP 81 PGUID 0 1255 0 0 0 0 0 f f r 18 0 0 ...@@ -144,26 +147,9 @@ DATA(insert OID = 1255 ( pg_proc PGNSP 81 PGUID 0 1255 0 0 0 0 0 f f r 18 0 0
DESCR(""); DESCR("");
DATA(insert OID = 1259 ( pg_class PGNSP 83 PGUID 0 1259 0 0 0 0 0 f f r 25 0 0 0 0 0 t f f f _null_ )); DATA(insert OID = 1259 ( pg_class PGNSP 83 PGUID 0 1259 0 0 0 0 0 f f r 25 0 0 0 0 0 t f f f _null_ ));
DESCR(""); DESCR("");
DATA(insert OID = 1260 ( pg_shadow PGNSP 86 PGUID 0 1260 1664 0 0 0 0 f t r 8 0 0 0 0 0 f f f f _null_ ));
DESCR("");
DATA(insert OID = 1261 ( pg_group PGNSP 87 PGUID 0 1261 1664 0 0 0 0 f t r 3 0 0 0 0 0 f f f f _null_ ));
DESCR("");
DATA(insert OID = 1262 ( pg_database PGNSP 88 PGUID 0 1262 1664 0 0 0 0 f t r 11 0 0 0 0 0 t f f f _null_ ));
DESCR("");
DATA(insert OID = 1213 ( pg_tablespace PGNSP 90 PGUID 0 1213 1664 0 0 0 0 f t r 4 0 0 0 0 0 t f f f _null_ ));
DESCR("");
DATA(insert OID = 376 ( pg_xactlock PGNSP 0 PGUID 0 0 1664 0 0 0 0 f t s 1 0 0 0 0 0 f f f f _null_ )); DATA(insert OID = 376 ( pg_xactlock PGNSP 0 PGUID 0 0 1664 0 0 0 0 f t s 1 0 0 0 0 0 f f f f _null_ ));
DESCR(""); DESCR("");
#define RelOid_pg_type 1247
#define RelOid_pg_attribute 1249
#define RelOid_pg_proc 1255
#define RelOid_pg_class 1259
#define RelOid_pg_shadow 1260
#define RelOid_pg_group 1261
#define RelOid_pg_database 1262
#define RelOid_pg_tablespace 1213
/* Xact lock pseudo-table */ /* Xact lock pseudo-table */
#define XactLockTableId 376 #define XactLockTableId 376
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_constraint.h,v 1.15 2005/03/25 21:57:59 tgl Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_constraint.h,v 1.16 2005/04/14 01:38:20 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/* ---------------- /* ----------------
* postgres.h contains the system type definitions and the * postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler. * can be read by both genbki.sh and the C compiler.
* ---------------- * ----------------
*/ */
...@@ -31,7 +31,9 @@ ...@@ -31,7 +31,9 @@
* typedef struct FormData_pg_constraint * typedef struct FormData_pg_constraint
* ---------------- * ----------------
*/ */
CATALOG(pg_constraint) #define ConstraintRelationId 2606
CATALOG(pg_constraint,2606)
{ {
/* /*
* conname + connamespace is deliberately not unique; we allow, for * conname + connamespace is deliberately not unique; we allow, for
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_conversion.h,v 1.14 2004/12/31 22:03:24 pgsql Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_conversion.h,v 1.15 2005/04/14 01:38:20 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/* ---------------- /* ----------------
* postgres.h contains the system type definitions and the * postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler. * can be read by both genbki.sh and the C compiler.
* ---------------- * ----------------
*/ */
...@@ -40,7 +40,9 @@ ...@@ -40,7 +40,9 @@
* condefault TRUE if this is a default conversion * condefault TRUE if this is a default conversion
* ---------------------------------------------------------------- * ----------------------------------------------------------------
*/ */
CATALOG(pg_conversion) #define ConversionRelationId 2607
CATALOG(pg_conversion,2607)
{ {
NameData conname; NameData conname;
Oid connamespace; Oid connamespace;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_database.h,v 1.34 2004/12/31 22:03:24 pgsql Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_database.h,v 1.35 2005/04/14 01:38:20 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/* ---------------- /* ----------------
* postgres.h contains the system type definitions and the * postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler. * can be read by both genbki.sh and the C compiler.
* ---------------- * ----------------
*/ */
...@@ -31,7 +31,9 @@ ...@@ -31,7 +31,9 @@
* typedef struct FormData_pg_database * typedef struct FormData_pg_database
* ---------------- * ----------------
*/ */
CATALOG(pg_database) BOOTSTRAP BKI_SHARED_RELATION #define DatabaseRelationId 1262
CATALOG(pg_database,1262) BKI_SHARED_RELATION
{ {
NameData datname; /* database name */ NameData datname; /* database name */
int4 datdba; /* sysid of owner */ int4 datdba; /* sysid of owner */
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_depend.h,v 1.5 2004/12/31 22:03:24 pgsql Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_depend.h,v 1.6 2005/04/14 01:38:20 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/* ---------------- /* ----------------
* postgres.h contains the system type definitions and the * postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler. * can be read by both genbki.sh and the C compiler.
* ---------------- * ----------------
*/ */
...@@ -31,7 +31,9 @@ ...@@ -31,7 +31,9 @@
* typedef struct FormData_pg_depend * typedef struct FormData_pg_depend
* ---------------- * ----------------
*/ */
CATALOG(pg_depend) BKI_WITHOUT_OIDS #define DependRelationId 2608
CATALOG(pg_depend,2608) BKI_WITHOUT_OIDS
{ {
/* /*
* Identification of the dependent (referencing) object. * Identification of the dependent (referencing) object.
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_description.h,v 1.22 2004/12/31 22:03:24 pgsql Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_description.h,v 1.23 2005/04/14 01:38:20 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
/* ---------------- /* ----------------
* postgres.h contains the system type definitions and the * postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler. * can be read by both genbki.sh and the C compiler.
* ---------------- * ----------------
*/ */
...@@ -48,7 +48,9 @@ ...@@ -48,7 +48,9 @@
* typedef struct FormData_pg_description * typedef struct FormData_pg_description
* ---------------- * ----------------
*/ */
CATALOG(pg_description) BKI_WITHOUT_OIDS #define DescriptionRelationId 2609
CATALOG(pg_description,2609) BKI_WITHOUT_OIDS
{ {
Oid objoid; /* OID of object itself */ Oid objoid; /* OID of object itself */
Oid classoid; /* OID of table containing object */ Oid classoid; /* OID of table containing object */
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_group.h,v 1.20 2004/12/31 22:03:24 pgsql Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_group.h,v 1.21 2005/04/14 01:38:20 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -20,12 +20,13 @@ ...@@ -20,12 +20,13 @@
/* ---------------- /* ----------------
* postgres.h contains the system type definitions and the * postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler. * can be read by both genbki.sh and the C compiler.
* ---------------- * ----------------
*/ */
#define GroupRelationId 1261
CATALOG(pg_group) BOOTSTRAP BKI_SHARED_RELATION BKI_WITHOUT_OIDS CATALOG(pg_group,1261) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
{ {
NameData groname; NameData groname;
int4 grosysid; int4 grosysid;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_index.h,v 1.36 2005/03/29 00:17:17 tgl Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_index.h,v 1.37 2005/04/14 01:38:20 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/* ---------------- /* ----------------
* postgres.h contains the system type definitions and the * postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler. * can be read by both genbki.sh and the C compiler.
* ---------------- * ----------------
*/ */
...@@ -31,7 +31,9 @@ ...@@ -31,7 +31,9 @@
* typedef struct FormData_pg_index. * typedef struct FormData_pg_index.
* ---------------- * ----------------
*/ */
CATALOG(pg_index) BKI_WITHOUT_OIDS #define IndexRelationId 2610
CATALOG(pg_index,2610) BKI_WITHOUT_OIDS
{ {
Oid indexrelid; /* OID of the index */ Oid indexrelid; /* OID of the index */
Oid indrelid; /* OID of the relation it indexes */ Oid indrelid; /* OID of the relation it indexes */
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_inherits.h,v 1.19 2004/12/31 22:03:24 pgsql Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_inherits.h,v 1.20 2005/04/14 01:38:20 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/* ---------------- /* ----------------
* postgres.h contains the system type definitions and the * postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler. * can be read by both genbki.sh and the C compiler.
* ---------------- * ----------------
*/ */
...@@ -31,7 +31,9 @@ ...@@ -31,7 +31,9 @@
* typedef struct FormData_pg_inherits * typedef struct FormData_pg_inherits
* ---------------- * ----------------
*/ */
CATALOG(pg_inherits) BKI_WITHOUT_OIDS #define InheritsRelationId 2611
CATALOG(pg_inherits,2611) BKI_WITHOUT_OIDS
{ {
Oid inhrelid; Oid inhrelid;
Oid inhparent; Oid inhparent;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_language.h,v 1.25 2004/12/31 22:03:24 pgsql Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_language.h,v 1.26 2005/04/14 01:38:20 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/* ---------------- /* ----------------
* postgres.h contains the system type definitions and the * postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler. * can be read by both genbki.sh and the C compiler.
* ---------------- * ----------------
*/ */
...@@ -31,7 +31,9 @@ ...@@ -31,7 +31,9 @@
* typedef struct FormData_pg_language * typedef struct FormData_pg_language
* ---------------- * ----------------
*/ */
CATALOG(pg_language) #define LanguageRelationId 2612
CATALOG(pg_language,2612)
{ {
NameData lanname; NameData lanname;
bool lanispl; /* Is a procedural language */ bool lanispl; /* Is a procedural language */
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_largeobject.h,v 1.18 2004/12/31 22:03:24 pgsql Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_largeobject.h,v 1.19 2005/04/14 01:38:20 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/* ---------------- /* ----------------
* postgres.h contains the system type definitions and the * postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler. * can be read by both genbki.sh and the C compiler.
* ---------------- * ----------------
*/ */
...@@ -31,8 +31,9 @@ ...@@ -31,8 +31,9 @@
* typedef struct FormData_pg_largeobject * typedef struct FormData_pg_largeobject
* ---------------- * ----------------
*/ */
#define LargeObjectRelationId 2613
CATALOG(pg_largeobject) BKI_WITHOUT_OIDS CATALOG(pg_largeobject,2613) BKI_WITHOUT_OIDS
{ {
Oid loid; /* Identifier of large object */ Oid loid; /* Identifier of large object */
int4 pageno; /* Page number (starting from 0) */ int4 pageno; /* Page number (starting from 0) */
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_listener.h,v 1.18 2004/12/31 22:03:24 pgsql Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_listener.h,v 1.19 2005/04/14 01:38:20 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
/* ---------------- /* ----------------
* postgres.h contains the system type definitions and the * postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler. * can be read by both genbki.sh and the C compiler.
* ---------------- * ----------------
*/ */
...@@ -31,8 +31,9 @@ ...@@ -31,8 +31,9 @@
* cpp turns this into typedef struct FormData_pg_listener * cpp turns this into typedef struct FormData_pg_listener
* ---------------------------------------------------------------- * ----------------------------------------------------------------
*/ */
#define ListenerRelationId 2614
CATALOG(pg_listener) BKI_WITHOUT_OIDS CATALOG(pg_listener,2614) BKI_WITHOUT_OIDS
{ {
NameData relname; NameData relname;
int4 listenerpid; int4 listenerpid;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_namespace.h,v 1.16 2004/12/31 22:03:24 pgsql Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_namespace.h,v 1.17 2005/04/14 01:38:20 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/* ---------------- /* ----------------
* postgres.h contains the system type definitions and the * postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler. * can be read by both genbki.sh and the C compiler.
* ---------------- * ----------------
*/ */
...@@ -36,7 +36,9 @@ ...@@ -36,7 +36,9 @@
* nspacl access privilege list * nspacl access privilege list
* ---------------------------------------------------------------- * ----------------------------------------------------------------
*/ */
CATALOG(pg_namespace) #define NamespaceRelationId 2615
CATALOG(pg_namespace,2615)
{ {
NameData nspname; NameData nspname;
int4 nspowner; int4 nspowner;
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_opclass.h,v 1.63 2005/03/26 23:29:19 tgl Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_opclass.h,v 1.64 2005/04/14 01:38:20 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
/* ---------------- /* ----------------
* postgres.h contains the system type definitions and the * postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler. * can be read by both genbki.sh and the C compiler.
* ---------------- * ----------------
*/ */
...@@ -50,8 +50,9 @@ ...@@ -50,8 +50,9 @@
* typedef struct FormData_pg_opclass * typedef struct FormData_pg_opclass
* ---------------- * ----------------
*/ */
#define OperatorClassRelationId 2616
CATALOG(pg_opclass) CATALOG(pg_opclass,2616)
{ {
Oid opcamid; /* index access method opclass is for */ Oid opcamid; /* index access method opclass is for */
NameData opcname; /* name of this opclass */ NameData opcname; /* name of this opclass */
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_operator.h,v 1.130 2004/12/31 22:03:24 pgsql Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_operator.h,v 1.131 2005/04/14 01:38:20 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
/* ---------------- /* ----------------
* postgres.h contains the system type definitions and the * postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler. * can be read by both genbki.sh and the C compiler.
* ---------------- * ----------------
*/ */
...@@ -36,7 +36,9 @@ ...@@ -36,7 +36,9 @@
* typedef struct FormData_pg_operator * typedef struct FormData_pg_operator
* ---------------- * ----------------
*/ */
CATALOG(pg_operator) #define OperatorRelationId 2617
CATALOG(pg_operator,2617)
{ {
NameData oprname; /* name of operator */ NameData oprname; /* name of operator */
Oid oprnamespace; /* OID of namespace containing this oper */ Oid oprnamespace; /* OID of namespace containing this oper */
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.358 2005/04/12 04:26:28 tgl Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.359 2005/04/14 01:38:20 tgl Exp $
* *
* NOTES * NOTES
* The script catalog/genbki.sh reads this file and generates .bki * The script catalog/genbki.sh reads this file and generates .bki
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
/* ---------------- /* ----------------
* postgres.h contains the system type definitions and the * postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler. * can be read by both genbki.sh and the C compiler.
* ---------------- * ----------------
*/ */
...@@ -35,7 +35,9 @@ ...@@ -35,7 +35,9 @@
* typedef struct FormData_pg_proc * typedef struct FormData_pg_proc
* ---------------- * ----------------
*/ */
CATALOG(pg_proc) BOOTSTRAP #define ProcedureRelationId 1255
CATALOG(pg_proc,1255) BKI_BOOTSTRAP
{ {
NameData proname; /* procedure name */ NameData proname; /* procedure name */
Oid pronamespace; /* OID of namespace containing this proc */ Oid pronamespace; /* OID of namespace containing this proc */
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_rewrite.h,v 1.24 2004/12/31 22:03:25 pgsql Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_rewrite.h,v 1.25 2005/04/14 01:38:21 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
/* ---------------- /* ----------------
* postgres.h contains the system type definitions and the * postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler. * can be read by both genbki.sh and the C compiler.
* ---------------- * ----------------
*/ */
...@@ -34,7 +34,9 @@ ...@@ -34,7 +34,9 @@
* typedef struct FormData_pg_rewrite * typedef struct FormData_pg_rewrite
* ---------------- * ----------------
*/ */
CATALOG(pg_rewrite) #define RewriteRelationId 2618
CATALOG(pg_rewrite,2618)
{ {
NameData rulename; NameData rulename;
Oid ev_class; Oid ev_class;
......
...@@ -3,21 +3,19 @@ ...@@ -3,21 +3,19 @@
* pg_shadow.h * pg_shadow.h
* definition of the system "shadow" relation (pg_shadow) * definition of the system "shadow" relation (pg_shadow)
* along with the relation's initial contents. * along with the relation's initial contents.
* pg_user is now a public accessible view on pg_shadow. *
* pg_user is now a publicly accessible view on pg_shadow.
* *
* *
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_shadow.h,v 1.27 2004/12/31 22:03:26 pgsql Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_shadow.h,v 1.28 2005/04/14 01:38:21 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
* information from the DATA() statements. * information from the DATA() statements.
* *
* WHENEVER the definition for pg_shadow changes, the
* view creation of pg_user must be changed in initdb.sh!
*
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
#ifndef PG_SHADOW_H #ifndef PG_SHADOW_H
...@@ -29,7 +27,9 @@ ...@@ -29,7 +27,9 @@
* typedef struct FormData_pg_shadow * typedef struct FormData_pg_shadow
* ---------------- * ----------------
*/ */
CATALOG(pg_shadow) BOOTSTRAP BKI_SHARED_RELATION BKI_WITHOUT_OIDS #define ShadowRelationId 1260
CATALOG(pg_shadow,1260) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
{ {
NameData usename; NameData usename;
int4 usesysid; int4 usesysid;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_statistic.h,v 1.28 2004/12/31 22:03:26 pgsql Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_statistic.h,v 1.29 2005/04/14 01:38:21 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/* ---------------- /* ----------------
* postgres.h contains the system type definitions and the * postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler. * can be read by both genbki.sh and the C compiler.
* ---------------- * ----------------
*/ */
...@@ -37,7 +37,9 @@ typedef struct varlena anyarray; ...@@ -37,7 +37,9 @@ typedef struct varlena anyarray;
* typedef struct FormData_pg_statistic * typedef struct FormData_pg_statistic
* ---------------- * ----------------
*/ */
CATALOG(pg_statistic) BKI_WITHOUT_OIDS #define StatisticRelationId 2619
CATALOG(pg_statistic,2619) BKI_WITHOUT_OIDS
{ {
/* These fields form the unique key for the entry: */ /* These fields form the unique key for the entry: */
Oid starelid; /* relation containing attribute */ Oid starelid; /* relation containing attribute */
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_tablespace.h,v 1.5 2004/12/31 22:03:26 pgsql Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_tablespace.h,v 1.6 2005/04/14 01:38:21 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/* ---------------- /* ----------------
* postgres.h contains the system type definitions and the * postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler. * can be read by both genbki.sh and the C compiler.
* ---------------- * ----------------
*/ */
...@@ -31,7 +31,9 @@ ...@@ -31,7 +31,9 @@
* typedef struct FormData_pg_tablespace * typedef struct FormData_pg_tablespace
* ---------------- * ----------------
*/ */
CATALOG(pg_tablespace) BOOTSTRAP BKI_SHARED_RELATION #define TableSpaceRelationId 1213
CATALOG(pg_tablespace,1213) BKI_SHARED_RELATION
{ {
NameData spcname; /* tablespace name */ NameData spcname; /* tablespace name */
int4 spcowner; /* sysid of owner */ int4 spcowner; /* sysid of owner */
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
/* ---------------- /* ----------------
* postgres.h contains the system type definitions and the * postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler. * can be read by both genbki.sh and the C compiler.
* ---------------- * ----------------
*/ */
...@@ -27,7 +27,9 @@ ...@@ -27,7 +27,9 @@
* typedef struct FormData_pg_trigger * typedef struct FormData_pg_trigger
* ---------------- * ----------------
*/ */
CATALOG(pg_trigger) #define TriggerRelationId 2620
CATALOG(pg_trigger,2620)
{ {
Oid tgrelid; /* triggered relation */ Oid tgrelid; /* triggered relation */
NameData tgname; /* trigger' name */ NameData tgname; /* trigger' name */
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/catalog/pg_type.h,v 1.159 2005/03/29 00:17:17 tgl Exp $ * $PostgreSQL: pgsql/src/include/catalog/pg_type.h,v 1.160 2005/04/14 01:38:21 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
/* ---------------- /* ----------------
* postgres.h contains the system type definitions and the * postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler. * can be read by both genbki.sh and the C compiler.
* ---------------- * ----------------
*/ */
...@@ -38,7 +38,9 @@ ...@@ -38,7 +38,9 @@
* See struct FormData_pg_attribute for details. * See struct FormData_pg_attribute for details.
* ---------------- * ----------------
*/ */
CATALOG(pg_type) BOOTSTRAP #define TypeRelationId 1247
CATALOG(pg_type,1247) BKI_BOOTSTRAP
{ {
NameData typname; /* type name */ NameData typname; /* type name */
Oid typnamespace; /* OID of namespace containing this type */ Oid typnamespace; /* OID of namespace containing this type */
...@@ -304,6 +306,8 @@ DATA(insert OID = 30 ( oidvector PGNSP PGUID -1 f b t \054 0 26 oidvectorin oi ...@@ -304,6 +306,8 @@ DATA(insert OID = 30 ( oidvector PGNSP PGUID -1 f b t \054 0 26 oidvectorin oi
DESCR("array of oids, used in system tables"); DESCR("array of oids, used in system tables");
#define OIDVECTOROID 30 #define OIDVECTOROID 30
/* hand-built rowtype entries for bootstrapped catalogs: */
DATA(insert OID = 71 ( pg_type PGNSP PGUID -1 f c t \054 1247 0 record_in record_out record_recv record_send - d x f 0 -1 0 _null_ _null_ )); DATA(insert OID = 71 ( pg_type PGNSP PGUID -1 f c t \054 1247 0 record_in record_out record_recv record_send - d x f 0 -1 0 _null_ _null_ ));
#define PG_TYPE_RELTYPE_OID 71 #define PG_TYPE_RELTYPE_OID 71
DATA(insert OID = 75 ( pg_attribute PGNSP PGUID -1 f c t \054 1249 0 record_in record_out record_recv record_send - d x f 0 -1 0 _null_ _null_ )); DATA(insert OID = 75 ( pg_attribute PGNSP PGUID -1 f c t \054 1249 0 record_in record_out record_recv record_send - d x f 0 -1 0 _null_ _null_ ));
...@@ -312,10 +316,6 @@ DATA(insert OID = 81 ( pg_proc PGNSP PGUID -1 f c t \054 1255 0 record_in reco ...@@ -312,10 +316,6 @@ DATA(insert OID = 81 ( pg_proc PGNSP PGUID -1 f c t \054 1255 0 record_in reco
#define PG_PROC_RELTYPE_OID 81 #define PG_PROC_RELTYPE_OID 81
DATA(insert OID = 83 ( pg_class PGNSP PGUID -1 f c t \054 1259 0 record_in record_out record_recv record_send - d x f 0 -1 0 _null_ _null_ )); DATA(insert OID = 83 ( pg_class PGNSP PGUID -1 f c t \054 1259 0 record_in record_out record_recv record_send - d x f 0 -1 0 _null_ _null_ ));
#define PG_CLASS_RELTYPE_OID 83 #define PG_CLASS_RELTYPE_OID 83
DATA(insert OID = 86 ( pg_shadow PGNSP PGUID -1 f c t \054 1260 0 record_in record_out record_recv record_send - d x f 0 -1 0 _null_ _null_ ));
DATA(insert OID = 87 ( pg_group PGNSP PGUID -1 f c t \054 1261 0 record_in record_out record_recv record_send - d x f 0 -1 0 _null_ _null_ ));
DATA(insert OID = 88 ( pg_database PGNSP PGUID -1 f c t \054 1262 0 record_in record_out record_recv record_send - d x f 0 -1 0 _null_ _null_ ));
DATA(insert OID = 90 ( pg_tablespace PGNSP PGUID -1 f c t \054 1213 0 record_in record_out record_recv record_send - d x f 0 -1 0 _null_ _null_ ));
/* OIDS 100 - 199 */ /* OIDS 100 - 199 */
......
/*-------------------------------------------------------------------------
*
* pg_version.h
* definition of the system "version" relation (pg_version)
* along with the relation's initial contents.
*
* NOTE: this table has nothing to do with the overall Postgres system
* version or anything like that. It is for defining individual relations
* that have multiple concurrently-existing versions. Yes, there used to
* be such a feature in Postgres, but it's been broken for a long time
* (see src/backend/commands/_deadcode/version.c). The pg_version table
* isn't even created at present.
*
*
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/catalog/pg_version.h,v 1.20 2004/12/31 22:03:26 pgsql Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
*/
#ifndef PG_VERSION_H
#define PG_VERSION_H
/* ----------------
* postgres.h contains the system type definitions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler.
* ----------------
*/
/* ----------------
* pg_version definition. cpp turns this into
* typedef struct FormData_pg_version
* ----------------
*/
CATALOG(pg_version)
{
Oid verrelid;
Oid verbaseid;
int4 vertime; /* really should be some abstime */
} FormData_pg_version;
/* ----------------
* Form_pg_version corresponds to a pointer to a tuple with
* the format of pg_version relation.
* ----------------
*/
typedef FormData_pg_version *Form_pg_version;
/* ----------------
* compiler constants for pg_version
* ----------------
*/
#define Natts_pg_version 3
#define Anum_pg_version_verrelid 1
#define Anum_pg_version_verbaseid 2
#define Anum_pg_version_vertime 3
#endif /* PG_VERSION_H */
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# unused_oids # unused_oids
# #
# $PostgreSQL: pgsql/src/include/catalog/unused_oids,v 1.6 2005/04/13 18:54:57 tgl Exp $ # $PostgreSQL: pgsql/src/include/catalog/unused_oids,v 1.7 2005/04/14 01:38:21 tgl Exp $
# #
# finds blocks of manually-assignable oids that have not already been # finds blocks of manually-assignable oids that have not already been
# claimed by post_hackers. primarily useful for finding available # claimed by post_hackers. primarily useful for finding available
...@@ -23,11 +23,19 @@ AWK="awk" ...@@ -23,11 +23,19 @@ AWK="awk"
FIRSTOBJECTID=`grep '#define[ ]*FirstBootstrapObjectId' ../access/transam.h | $AWK '{ print $3 }'` FIRSTOBJECTID=`grep '#define[ ]*FirstBootstrapObjectId' ../access/transam.h | $AWK '{ print $3 }'`
export FIRSTOBJECTID export FIRSTOBJECTID
egrep '^DATA' pg_*.h | \ # this part (down to the uniq step) should match the unused_oids script
sed -e 's/^.*OID[^=]*=[^0-9]*//' -e 's/[^0-9].*$//' | \ # note: we exclude BKI_BOOTSTRAP relations since they are expected to have
sort -n | \ # matching DATA lines in pg_class.h
uniq | \
$AWK ' cat pg_*.h indexing.h | \
egrep -v -e '^CATALOG\(.*BKI_BOOTSTRAP' | \
sed -n -e 's/^DATA(insert *OID *= *\([0-9][0-9]*\).*$/\1/p' \
-e 's/^CATALOG([^,]*, *\([0-9][0-9]*\).*$/\1/p' \
-e 's/^DECLARE_INDEX([^,]*, *\([0-9][0-9]*\).*$/\1/p' \
-e 's/^DECLARE_UNIQUE_INDEX([^,]*, *\([0-9][0-9]*\).*$/\1/p' | \
sort -n | \
uniq | \
$AWK '
BEGIN { BEGIN {
last = 0; last = 0;
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/commands/defrem.h,v 1.63 2005/03/14 00:19:37 neilc Exp $ * $PostgreSQL: pgsql/src/include/commands/defrem.h,v 1.64 2005/04/14 01:38:21 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
/* commands/indexcmds.c */ /* commands/indexcmds.c */
extern void DefineIndex(RangeVar *heapRelation, extern void DefineIndex(RangeVar *heapRelation,
char *indexRelationName, char *indexRelationName,
Oid indexRelationId,
char *accessMethodName, char *accessMethodName,
char *tableSpaceName, char *tableSpaceName,
List *attributeList, List *attributeList,
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1995, Regents of the University of California * Portions Copyright (c) 1995, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/postgres.h,v 1.70 2004/12/31 22:03:19 pgsql Exp $ * $PostgreSQL: pgsql/src/include/postgres.h,v 1.71 2005/04/14 01:38:21 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -532,9 +532,9 @@ extern int ExceptionalCondition(char *conditionName, char *errorType, ...@@ -532,9 +532,9 @@ extern int ExceptionalCondition(char *conditionName, char *errorType,
* Section 4: genbki macros used by catalog/pg_xxx.h files * Section 4: genbki macros used by catalog/pg_xxx.h files
* ---------------------------------------------------------------- * ----------------------------------------------------------------
*/ */
#define CATALOG(x) typedef struct CppConcat(FormData_,x) #define CATALOG(name,oid) typedef struct CppConcat(FormData_,name)
#define BOOTSTRAP #define BKI_BOOTSTRAP
#define BKI_SHARED_RELATION #define BKI_SHARED_RELATION
#define BKI_WITHOUT_OIDS #define BKI_WITHOUT_OIDS
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/utils/relcache.h,v 1.48 2005/01/10 20:02:24 tgl Exp $ * $PostgreSQL: pgsql/src/include/utils/relcache.h,v 1.49 2005/04/14 01:38:22 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -53,8 +53,7 @@ extern Relation RelationBuildLocalRelation(const char *relname, ...@@ -53,8 +53,7 @@ extern Relation RelationBuildLocalRelation(const char *relname,
TupleDesc tupDesc, TupleDesc tupDesc,
Oid relid, Oid relid,
Oid reltablespace, Oid reltablespace,
bool shared_relation, bool shared_relation);
bool nailit);
/* /*
* Routines for flushing/rebuilding relcache entries in various scenarios * Routines for flushing/rebuilding relcache entries in various scenarios
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment