Skip to content

Commit 25aa0f8

Browse files
committed
New system relations to store DEFAULT/CHECK expressions.
1 parent 197ced5 commit 25aa0f8

File tree

6 files changed

+490
-345
lines changed

6 files changed

+490
-345
lines changed

src/include/catalog/indexing.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: indexing.h,v 1.2 1996/11/06 07:05:18 scrappy Exp $
10+
* $Id: indexing.h,v 1.3 1997/08/21 01:37:48 vadim Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -24,6 +24,8 @@
2424
#define Num_pg_proc_indices 3
2525
#define Num_pg_type_indices 2
2626
#define Num_pg_class_indices 2
27+
#define Num_pg_attrdef_indices 1
28+
#define Num_pg_relcheck_indices 1
2729

2830

2931
/*
@@ -39,11 +41,15 @@
3941
#define TypeOidIndex "pg_typeidind"
4042
#define ClassNameIndex "pg_classnameind"
4143
#define ClassOidIndex "pg_classoidind"
44+
#define AttrDefaultIndex "pg_attrdefind"
45+
#define RelCheckIndex "pg_relcheckind"
4246

4347
extern char *Name_pg_attr_indices[];
4448
extern char *Name_pg_proc_indices[];
4549
extern char *Name_pg_type_indices[];
4650
extern char *Name_pg_class_indices[];
51+
extern char *Name_pg_attrdef_indices[];
52+
extern char *Name_pg_relcheck_indices[];
4753

4854
extern char *IndexedCatalogNames[];
4955

@@ -98,6 +104,9 @@ DECLARE_INDEX(pg_typenameind on pg_type using btree (typname name_ops));
98104
DECLARE_INDEX(pg_classnameind on pg_class using btree (relname name_ops));
99105
DECLARE_INDEX(pg_classoidind on pg_class using btree (Oid oid_ops));
100106

107+
DECLARE_INDEX(pg_attrdefind on pg_attrdef using btree (adrelid oid_ops));
108+
DECLARE_INDEX(pg_relcheckind on pg_relcheck using btree (rcrelid oid_ops));
109+
101110
/* now build indices in the initialization scripts */
102111
BUILD_INDICES
103112

src/include/catalog/pg_attrdef.h

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* pg_attrdef.h--
4+
*
5+
*
6+
* Copyright (c) 1994, Regents of the University of California
7+
*
8+
* NOTES
9+
* the genbki.sh script reads this file and generates .bki
10+
* information from the DATA() statements.
11+
*
12+
*-------------------------------------------------------------------------
13+
*/
14+
#ifndef PG_ATTRDEF_H
15+
#define PG_ATTRDEF_H
16+
17+
/* ----------------
18+
* postgres.h contains the system type definintions and the
19+
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file
20+
* can be read by both genbki.sh and the C compiler.
21+
* ----------------
22+
*/
23+
24+
/* ----------------
25+
* pg_attrdef definition. cpp turns this into
26+
* typedef struct FormData_pg_attrdef
27+
* ----------------
28+
*/
29+
CATALOG(pg_attrdef) BOOTSTRAP {
30+
Oid adrelid;
31+
int2 adnum;
32+
text adbin;
33+
text adsrc;
34+
} FormData_pg_attrdef;
35+
36+
/* ----------------
37+
* Form_pg_attrdef corresponds to a pointer to a tuple with
38+
* the format of pg_attrdef relation.
39+
* ----------------
40+
*/
41+
typedef FormData_pg_attrdef *Form_pg_attrdef;
42+
43+
/* ----------------
44+
* compiler constants for pg_attrdef
45+
* ----------------
46+
*/
47+
#define Natts_pg_attrdef 4
48+
#define Anum_pg_attrdef_adrelid 1
49+
#define Anum_pg_attrdef_adnum 2
50+
#define Anum_pg_attrdef_adbin 3
51+
#define Anum_pg_attrdef_adsrc 4
52+
53+
54+
#endif /* PG_ATTRDEF_H */

0 commit comments

Comments
 (0)