]> granicus.if.org Git - postgresql/blob - src/include/catalog/pg_rewrite.h
First phase of project to use fixed OIDs for all system catalogs and
[postgresql] / src / include / catalog / pg_rewrite.h
1 /*-------------------------------------------------------------------------
2  *
3  * pg_rewrite.h
4  *        definition of the system "rewrite-rule" relation (pg_rewrite)
5  *        along with the relation's initial contents.
6  *
7  * As of Postgres 7.3, the primary key for this table is <ev_class, rulename>
8  * --- ie, rule names are only unique among the rules of a given table.
9  *
10  *
11  * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
12  * Portions Copyright (c) 1994, Regents of the University of California
13  *
14  * $PostgreSQL: pgsql/src/include/catalog/pg_rewrite.h,v 1.25 2005/04/14 01:38:21 tgl Exp $
15  *
16  * NOTES
17  *        the genbki.sh script reads this file and generates .bki
18  *        information from the DATA() statements.
19  *
20  *-------------------------------------------------------------------------
21  */
22 #ifndef PG_REWRITE_H
23 #define PG_REWRITE_H
24
25 /* ----------------
26  *              postgres.h contains the system type definitions and the
27  *              CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
28  *              can be read by both genbki.sh and the C compiler.
29  * ----------------
30  */
31
32 /* ----------------
33  *              pg_rewrite definition.  cpp turns this into
34  *              typedef struct FormData_pg_rewrite
35  * ----------------
36  */
37 #define RewriteRelationId  2618
38
39 CATALOG(pg_rewrite,2618)
40 {
41         NameData        rulename;
42         Oid                     ev_class;
43         int2            ev_attr;
44         char            ev_type;
45         bool            is_instead;
46
47         /* NB: remaining fields must be accessed via heap_getattr */
48         text            ev_qual;
49         text            ev_action;
50 } FormData_pg_rewrite;
51
52 /* ----------------
53  *              Form_pg_rewrite corresponds to a pointer to a tuple with
54  *              the format of pg_rewrite relation.
55  * ----------------
56  */
57 typedef FormData_pg_rewrite *Form_pg_rewrite;
58
59 /* ----------------
60  *              compiler constants for pg_rewrite
61  * ----------------
62  */
63 #define Natts_pg_rewrite                                7
64 #define Anum_pg_rewrite_rulename                1
65 #define Anum_pg_rewrite_ev_class                2
66 #define Anum_pg_rewrite_ev_attr                 3
67 #define Anum_pg_rewrite_ev_type                 4
68 #define Anum_pg_rewrite_is_instead              5
69 #define Anum_pg_rewrite_ev_qual                 6
70 #define Anum_pg_rewrite_ev_action               7
71
72 #endif   /* PG_REWRITE_H */