提交 25aa0f8d 编写于 作者: V Vadim B. Mikheev

New system relations to store DEFAULT/CHECK expressions.

上级 197ced59
......@@ -7,7 +7,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: indexing.h,v 1.2 1996/11/06 07:05:18 scrappy Exp $
* $Id: indexing.h,v 1.3 1997/08/21 01:37:48 vadim Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -24,6 +24,8 @@
#define Num_pg_proc_indices 3
#define Num_pg_type_indices 2
#define Num_pg_class_indices 2
#define Num_pg_attrdef_indices 1
#define Num_pg_relcheck_indices 1
/*
......@@ -39,11 +41,15 @@
#define TypeOidIndex "pg_typeidind"
#define ClassNameIndex "pg_classnameind"
#define ClassOidIndex "pg_classoidind"
#define AttrDefaultIndex "pg_attrdefind"
#define RelCheckIndex "pg_relcheckind"
extern char *Name_pg_attr_indices[];
extern char *Name_pg_proc_indices[];
extern char *Name_pg_type_indices[];
extern char *Name_pg_class_indices[];
extern char *Name_pg_attrdef_indices[];
extern char *Name_pg_relcheck_indices[];
extern char *IndexedCatalogNames[];
......@@ -98,6 +104,9 @@ DECLARE_INDEX(pg_typenameind on pg_type using btree (typname name_ops));
DECLARE_INDEX(pg_classnameind on pg_class using btree (relname name_ops));
DECLARE_INDEX(pg_classoidind on pg_class using btree (Oid oid_ops));
DECLARE_INDEX(pg_attrdefind on pg_attrdef using btree (adrelid oid_ops));
DECLARE_INDEX(pg_relcheckind on pg_relcheck using btree (rcrelid oid_ops));
/* now build indices in the initialization scripts */
BUILD_INDICES
......
/*-------------------------------------------------------------------------
*
* pg_attrdef.h--
*
*
* Copyright (c) 1994, Regents of the University of California
*
* NOTES
* the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
*/
#ifndef PG_ATTRDEF_H
#define PG_ATTRDEF_H
/* ----------------
* postgres.h contains the system type definintions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler.
* ----------------
*/
/* ----------------
* pg_attrdef definition. cpp turns this into
* typedef struct FormData_pg_attrdef
* ----------------
*/
CATALOG(pg_attrdef) BOOTSTRAP {
Oid adrelid;
int2 adnum;
text adbin;
text adsrc;
} FormData_pg_attrdef;
/* ----------------
* Form_pg_attrdef corresponds to a pointer to a tuple with
* the format of pg_attrdef relation.
* ----------------
*/
typedef FormData_pg_attrdef *Form_pg_attrdef;
/* ----------------
* compiler constants for pg_attrdef
* ----------------
*/
#define Natts_pg_attrdef 4
#define Anum_pg_attrdef_adrelid 1
#define Anum_pg_attrdef_adnum 2
#define Anum_pg_attrdef_adbin 3
#define Anum_pg_attrdef_adsrc 4
#endif /* PG_ATTRDEF_H */
此差异已折叠。
......@@ -7,7 +7,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_class.h,v 1.5 1997/04/02 03:29:35 vadim Exp $
* $Id: pg_class.h,v 1.6 1997/08/21 01:37:52 vadim Exp $
*
* NOTES
* ``pg_relation'' is being replaced by ``pg_class''. currently
......@@ -69,8 +69,7 @@ CATALOG(pg_class) BOOTSTRAP {
class which have attnum > 0 (= user attribute).
*/
int2 relsmgr;
int28 relkey; /* not used */
oid8 relkeyop; /* not used */
int2 relchecks; /* # of CHECK constraints */
bool relhasrules;
aclitem relacl[1]; /* this is here for the catalog */
} FormData_pg_class;
......@@ -96,8 +95,8 @@ typedef FormData_pg_class *Form_pg_class;
* relacl field.
* ----------------
*/
#define Natts_pg_class_fixed 17
#define Natts_pg_class 18
#define Natts_pg_class_fixed 16
#define Natts_pg_class 17
#define Anum_pg_class_relname 1
#define Anum_pg_class_reltype 2
#define Anum_pg_class_relowner 3
......@@ -112,31 +111,32 @@ typedef FormData_pg_class *Form_pg_class;
#define Anum_pg_class_relarch 12
#define Anum_pg_class_relnatts 13
#define Anum_pg_class_relsmgr 14
#define Anum_pg_class_relkey 15
#define Anum_pg_class_relkeyop 16
#define Anum_pg_class_relhasrules 17
#define Anum_pg_class_relacl 18
#define Anum_pg_class_relchecks 15
#define Anum_pg_class_relhasrules 16
#define Anum_pg_class_relacl 17
/* ----------------
* initial contents of pg_class
* ----------------
*/
DATA(insert OID = 1247 ( pg_type 71 PGUID 0 0 0 0 0 f f r n 16 0 - - f _null_ ));
DATA(insert OID = 1249 ( pg_attribute 75 PGUID 0 0 0 0 0 f f r n 16 0 - - f _null_ ));
DATA(insert OID = 1251 ( pg_demon 76 PGUID 0 0 0 0 0 f t r n 4 0 - - f _null_ ));
DATA(insert OID = 1253 ( pg_magic 80 PGUID 0 0 0 0 0 f t r n 2 0 - - f _null_ ));
DATA(insert OID = 1255 ( pg_proc 81 PGUID 0 0 0 0 0 f f r n 16 0 - - f _null_ ));
DATA(insert OID = 1257 ( pg_server 82 PGUID 0 0 0 0 0 f t r n 3 0 - - f _null_ ));
DATA(insert OID = 1259 ( pg_class 83 PGUID 0 0 0 0 0 f f r n 18 0 - - f _null_ ));
DATA(insert OID = 1260 ( pg_user 86 PGUID 0 0 0 0 0 f t r n 6 0 - - f _null_ ));
DATA(insert OID = 1261 ( pg_group 87 PGUID 0 0 0 0 0 f t s n 3 0 - - f _null_ ));
DATA(insert OID = 1262 ( pg_database 88 PGUID 0 0 0 0 0 f t r n 3 0 - - f _null_ ));
DATA(insert OID = 1263 ( pg_defaults 89 PGUID 0 0 0 0 0 f t r n 2 0 - - f _null_ ));
DATA(insert OID = 1264 ( pg_variable 90 PGUID 0 0 0 0 0 f t s n 2 0 - - f _null_ ));
DATA(insert OID = 1269 ( pg_log 99 PGUID 0 0 0 0 0 f t s n 1 0 - - f _null_ ));
DATA(insert OID = 1271 ( pg_time 100 PGUID 0 0 0 0 0 f t s n 1 0 - - f _null_ ));
DATA(insert OID = 1273 ( pg_hosts 101 PGUID 0 0 0 0 0 f t s n 3 0 - - f _null_ ));
DATA(insert OID = 1247 ( pg_type 71 PGUID 0 0 0 0 0 f f r n 16 0 0 f _null_ ));
DATA(insert OID = 1249 ( pg_attribute 75 PGUID 0 0 0 0 0 f f r n 16 0 0 f _null_ ));
DATA(insert OID = 1251 ( pg_demon 76 PGUID 0 0 0 0 0 f t r n 4 0 0 f _null_ ));
DATA(insert OID = 1253 ( pg_magic 80 PGUID 0 0 0 0 0 f t r n 2 0 0 f _null_ ));
DATA(insert OID = 1255 ( pg_proc 81 PGUID 0 0 0 0 0 f f r n 16 0 0 f _null_ ));
DATA(insert OID = 1257 ( pg_server 82 PGUID 0 0 0 0 0 f t r n 3 0 0 f _null_ ));
DATA(insert OID = 1259 ( pg_class 83 PGUID 0 0 0 0 0 f f r n 18 0 0 f _null_ ));
DATA(insert OID = 1260 ( pg_user 86 PGUID 0 0 0 0 0 f t r n 6 0 0 f _null_ ));
DATA(insert OID = 1261 ( pg_group 87 PGUID 0 0 0 0 0 f t s n 3 0 0 f _null_ ));
DATA(insert OID = 1262 ( pg_database 88 PGUID 0 0 0 0 0 f t r n 3 0 0 f _null_ ));
DATA(insert OID = 1263 ( pg_defaults 89 PGUID 0 0 0 0 0 f t r n 2 0 0 f _null_ ));
DATA(insert OID = 1264 ( pg_variable 90 PGUID 0 0 0 0 0 f t s n 2 0 0 f _null_ ));
DATA(insert OID = 1269 ( pg_log 99 PGUID 0 0 0 0 0 f t s n 1 0 0 f _null_ ));
DATA(insert OID = 1271 ( pg_time 100 PGUID 0 0 0 0 0 f t s n 1 0 0 f _null_ ));
DATA(insert OID = 1273 ( pg_hosts 101 PGUID 0 0 0 0 0 f t s n 3 0 0 f _null_ ));
DATA(insert OID = 1215 ( pg_attrdef 109 PGUID 0 0 0 0 0 t t s n 4 0 0 f _null_ ));
DATA(insert OID = 1216 ( pg_relcheck 110 PGUID 0 0 0 0 0 t t s n 4 0 0 f _null_ ));
#define RelOid_pg_type 1247
#define RelOid_pg_demon 1251
......@@ -153,6 +153,8 @@ DATA(insert OID = 1273 ( pg_hosts 101 PGUID 0 0 0 0 0 f t s n 3 0 - -
#define RelOid_pg_log 1269
#define RelOid_pg_time 1271
#define RelOid_pg_hosts 1273
#define RelOid_pg_attrdef 1215
#define RelOid_pg_relcheck 1216
#define MAX_SYSTEM_RELOID 1273 /* this does not seem to be used */
/* anywhere */
......
/*-------------------------------------------------------------------------
*
* pg_relcheck.h--
*
*
* Copyright (c) 1994, Regents of the University of California
*
* NOTES
* the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
*/
#ifndef PG_RELCHECK_H
#define PG_RELCHECK_H
/* ----------------
* postgres.h contains the system type definintions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler.
* ----------------
*/
/* ----------------
* pg_relcheck definition. cpp turns this into
* typedef struct FormData_pg_relcheck
* ----------------
*/
CATALOG(pg_relcheck) BOOTSTRAP {
Oid rcrelid;
NameData rcname;
text rcbin;
text rcsrc;
} FormData_pg_relcheck;
/* ----------------
* Form_pg_relcheck corresponds to a pointer to a tuple with
* the format of pg_relcheck relation.
* ----------------
*/
typedef FormData_pg_relcheck *Form_pg_relcheck;
/* ----------------
* compiler constants for pg_relcheck
* ----------------
*/
#define Natts_pg_relcheck 4
#define Anum_pg_relcheck_rcrelid 1
#define Anum_pg_relcheck_rcname 2
#define Anum_pg_relcheck_rcbin 3
#define Anum_pg_relcheck_rcsrc 4
#endif /* PG_RELCHECK_H */
......@@ -7,7 +7,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_type.h,v 1.13 1997/08/19 21:37:54 momjian Exp $
* $Id: pg_type.h,v 1.14 1997/08/21 01:37:55 vadim Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
......@@ -198,8 +198,10 @@ DATA(insert OID = 99 ( pg_log PGUID 1 1 t b t \054 1269 0 foo bar foo bar
/* OIDS 100 - 199 */
DATA(insert OID = 100 ( pg_time PGUID 1 1 t b t \054 1271 0 foo bar foo bar c _null_));
DATA(insert OID = 101 ( pg_hosts PGUID 1 1 t b t \054 1273 0 foo bar foo bar c _null_));
DATA(insert OID = 100 ( pg_time PGUID 1 1 t b t \054 1271 0 foo bar foo bar c _null_));
DATA(insert OID = 101 ( pg_hosts PGUID 1 1 t b t \054 1273 0 foo bar foo bar c _null_));
DATA(insert OID = 109 ( pg_attrdef PGUID 1 1 t b t \054 1215 0 foo bar foo bar c _null_));
DATA(insert OID = 110 ( pg_relcheck PGUID 1 1 t b t \054 1216 0 foo bar foo bar c _null_));
/* OIDS 200 - 299 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册