postgresql/src/include/catalog/pg_namespace.h
Tom Lane 7c13781ee7 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.
2005-04-14 01:38:22 +00:00

88 lines
2.4 KiB
C

/*-------------------------------------------------------------------------
*
* pg_namespace.h
* definition of the system "namespace" relation (pg_namespace)
* along with the relation's initial contents.
*
*
* 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_namespace.h,v 1.17 2005/04/14 01:38:20 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
*/
#ifndef PG_NAMESPACE_H
#define PG_NAMESPACE_H
/* ----------------
* postgres.h contains the system type definitions and the
* CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler.
* ----------------
*/
/* ----------------------------------------------------------------
* pg_namespace definition.
*
* cpp turns this into typedef struct FormData_pg_namespace
*
* nspname name of the namespace
* nspowner owner (creator) of the namespace
* nspacl access privilege list
* ----------------------------------------------------------------
*/
#define NamespaceRelationId 2615
CATALOG(pg_namespace,2615)
{
NameData nspname;
int4 nspowner;
aclitem nspacl[1]; /* VARIABLE LENGTH FIELD */
} FormData_pg_namespace;
/* ----------------
* Form_pg_namespace corresponds to a pointer to a tuple with
* the format of pg_namespace relation.
* ----------------
*/
typedef FormData_pg_namespace *Form_pg_namespace;
/* ----------------
* compiler constants for pg_namespace
* ----------------
*/
#define Natts_pg_namespace 3
#define Anum_pg_namespace_nspname 1
#define Anum_pg_namespace_nspowner 2
#define Anum_pg_namespace_nspacl 3
/* ----------------
* initial contents of pg_namespace
* ---------------
*/
DATA(insert OID = 11 ( "pg_catalog" PGUID _null_ ));
DESCR("System catalog schema");
#define PG_CATALOG_NAMESPACE 11
DATA(insert OID = 99 ( "pg_toast" PGUID _null_ ));
DESCR("Reserved schema for TOAST tables");
#define PG_TOAST_NAMESPACE 99
DATA(insert OID = 2200 ( "public" PGUID _null_ ));
DESCR("Standard public schema");
#define PG_PUBLIC_NAMESPACE 2200
/*
* prototypes for functions in pg_namespace.c
*/
extern Oid NamespaceCreate(const char *nspName, int32 ownerSysId);
#endif /* PG_NAMESPACE_H */