*
* pg_class.h
* definition of the system "relation" relation (pg_class)
* along with the relation's initial contents.
*
*
* Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_class.h
*
* NOTES
* the genbki.pl script reads this file and generates .bki
* information from the DATA() statements.
*
* -------------------------------------------------------------------------
*/
#ifndef PG_CLASS_H
#define PG_CLASS_H
#include "catalog/genbki.h"
* pg_class definition. cpp turns this into
* typedef struct FormData_pg_class
* ----------------
*/
#define RelationRelationId 1259
#define RelationRelation_Rowtype_Id 83
CATALOG(pg_class,1259) BKI_BOOTSTRAP BKI_ROWTYPE_OID(83) BKI_SCHEMA_MACRO
{
NameData relname;
Oid relnamespace;
Oid reltype;
* implicit row type */
Oid reloftype;
* composite type */
Oid relowner;
Oid relam;
Oid relfilenode;
Oid reltablespace;
float8 relpages;
float8 reltuples;
int4 relallvisible;
* up-to-date) */
Oid reltoastrelid;
Oid reltoastidxid;
Oid reldeltarelid;
Oid reldeltaidx;
Oid relcudescrelid;
Oid relcudescidx;
bool relhasindex;
bool relisshared;
char relpersistence;
char relkind;
int2 relnatts;
* Class pg_attribute must contain exactly "relnatts" user attributes
* (with attnums ranging from 1 to relnatts) for this class. It may also
* contain entries with negative attnums for system attributes.
*/
int2 relchecks;
bool relhasoids;
bool relhaspkey;
bool relhasrules;
bool relhastriggers;
bool relhassubclass;
int1 relcmprs;
bool relhasclusterkey;
bool relrowmovement;
char parttype;
ShortTransactionId relfrozenxid;
#ifdef CATALOG_VARLEN
aclitem relacl[1];
text reloptions[1];
#endif
char relreplident;
TransactionId relfrozenxid64;
Oid relbucket;
int2vector relbucketkey;
#ifdef CATALOG_VARLEN
TransactionId relminmxid;
* this is really a MultiXactId */
#endif
}
FormData_pg_class;
#define CLASS_TUPLE_SIZE (offsetof(FormData_pg_class, relfrozenxid) + sizeof(ShortTransactionId))
* Form_pg_class corresponds to a pointer to a tuple with
* the format of pg_class relation.
* ----------------
*/
typedef FormData_pg_class* Form_pg_class;
* compiler constants for pg_class
* ----------------
*/
#define Natts_pg_class 40
#define Anum_pg_class_relname 1
#define Anum_pg_class_relnamespace 2
#define Anum_pg_class_reltype 3
#define Anum_pg_class_reloftype 4
#define Anum_pg_class_relowner 5
#define Anum_pg_class_relam 6
#define Anum_pg_class_relfilenode 7
#define Anum_pg_class_reltablespace 8
#define Anum_pg_class_relpages 9
#define Anum_pg_class_reltuples 10
#define Anum_pg_class_relallvisible 11
#define Anum_pg_class_reltoastrelid 12
#define Anum_pg_class_reltoastidxid 13
#define Anum_pg_class_reldeltarelid 14
#define Anum_pg_class_reldeltaidx 15
#define Anum_pg_class_relcudescrelid 16
#define Anum_pg_class_relcudescidx 17
#define Anum_pg_class_relhasindex 18
#define Anum_pg_class_relisshared 19
#define Anum_pg_class_relpersistence 20
#define Anum_pg_class_relkind 21
#define Anum_pg_class_relnatts 22
#define Anum_pg_class_relchecks 23
#define Anum_pg_class_relhasoids 24
#define Anum_pg_class_relhaspkey 25
#define Anum_pg_class_relhasrules 26
#define Anum_pg_class_relhastriggers 27
#define Anum_pg_class_relhassubclass 28
#define ANUM_PG_CLASS_RELCMPRS 29
#define Anum_pg_class_relhasclusterkey 30
#define Anum_pg_clsss_relrowmovement 31
#define Anum_pg_class_parttype 32
#define Anum_pg_class_relfrozenxid 33
#define Anum_pg_class_relacl 34
#define Anum_pg_class_reloptions 35
#define Anum_pg_class_relreplident 36
#define Anum_pg_class_relfrozenxid64 37
#define Anum_pg_class_relbucket 38
#define Anum_pg_class_relbucketkey 39
#define Anum_pg_class_relminmxid 40
* initial contents of pg_class
*
* NOTE: only "bootstrapped" relations need to be declared here. Be sure that
* the OIDs listed here match those given in their CATALOG macros, and that
* the relnatts values are correct.
* ----------------
*/
* Note: "3" in the relfrozenxid and the relfrozenxid64 column stands for FirstNormalTransactionId;
* similarly, "1" in relminmxid stands for FirstMultiXactId.
*/
DATA(insert OID = 1247 ( pg_type PGNSP 71 0 PGUID 0 0 0 0 0 0 0 0 0 0 0 0 f f p r 30 0 t f f f f 0 f f n 3 _null_ _null_ n 3 _null_ _null_ 1));
DESCR("");
DATA(insert OID = 1249 ( pg_attribute PGNSP 75 0 PGUID 0 0 0 0 0 0 0 0 0 0 0 0 f f p r 25 0 f f f f f 0 f f n 3 _null_ _null_ n 3 _null_ _null_ 1));
DESCR("");
DATA(insert OID = 1255 ( pg_proc PGNSP 81 0 PGUID 0 0 0 0 0 0 0 0 0 0 0 0 f f p r 39 0 t f f f f 0 f f n 3 _null_ _null_ n 3 _null_ _null_ 1));
DESCR("");
DATA(insert OID = 7815 ( gs_package PGNSP 9745 0 PGUID 0 0 0 0 0 0 0 0 0 0 0 0 f f p r 8 0 t f f f f 0 f f n 3 _null_ _null_ n 3 _null_ _null_ 1));
DESCR("");
DATA(insert OID = 9815 ( pg_object_type PGNSP 2989 0 PGUID 0 0 0 0 0 0 0 0 0 0 0 0 f f p r 13 0 t f f f f 0 f f n 3 _null_ _null_ n 3 _null_ _null_ 1));
DESCR("");
DATA(insert OID = 1259 ( pg_class PGNSP 83 0 PGUID 0 0 0 0 0 0 0 0 0 0 0 0 f f p r 40 0 t f f f f 0 f f n 3 _null_ _null_ n 3 _null_ _null_ 1));
DESCR("");
#define RELKIND_RELATION 'r'
#define RELKIND_INDEX 'i'
#define RELKIND_GLOBAL_INDEX 'I'
#define RELKIND_SEQUENCE 'S'
#define RELKIND_LARGE_SEQUENCE 'L'
#define RELKIND_TOASTVALUE 't'
#define RELKIND_VIEW 'v'
#define RELKIND_MATVIEW 'm'
#define RELKIND_COMPOSITE_TYPE 'c'
#define RELKIND_FOREIGN_TABLE 'f'
#define RELKIND_STREAM 'e'
#define RELKIND_CONTQUERY 'o'
#define PARTTYPE_PARTITIONED_RELATION 'p'
#define PARTTYPE_SUBPARTITIONED_RELATION 's'
#define PARTTYPE_VALUE_PARTITIONED_RELATION 'v'
#define PARTTYPE_NON_PARTITIONED_RELATION 'n'
#define RELPERSISTENCE_PERMANENT 'p'
#define RELPERSISTENCE_UNLOGGED 'u'
#define RELPERSISTENCE_TEMP 't'
#define RELPERSISTENCE_GLOBAL_TEMP 'g'
#define REPLICA_IDENTITY_DEFAULT 'd'
#define REPLICA_IDENTITY_NOTHING 'n'
#define REPLICA_IDENTITY_FULL 'f'
* Relation kinds that have physical storage. These relations normally have
* relfilenode set to non-zero, but it can also be zero if the relation is
* mapped.
*/
#define RELKIND_HAS_STORAGE(relkind) \
((relkind) == RELKIND_RELATION || \
(relkind) == RELKIND_INDEX || \
(relkind) == RELKIND_SEQUENCE || \
(relkind) == RELKIND_TOASTVALUE)
#define RELKIND_IS_SEQUENCE(relkind) \
((relkind) == RELKIND_SEQUENCE || (relkind) == RELKIND_LARGE_SEQUENCE)
* an explicitly chosen candidate key's columns are used as identity;
* will still be set if the index has been dropped, in that case it
* has the same meaning as 'd'
*/
#define REPLICA_IDENTITY_INDEX 'i'
#endif