PostgreSQL Source Code  git master
pg_rewrite.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * pg_rewrite.h
4  * definition of the "rewrite rule" system catalog (pg_rewrite)
5  *
6  * As of Postgres 7.3, the primary key for this table is <ev_class, rulename>
7  * --- ie, rule names are only unique among the rules of a given table.
8  *
9  *
10  * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
11  * Portions Copyright (c) 1994, Regents of the University of California
12  *
13  * src/include/catalog/pg_rewrite.h
14  *
15  * NOTES
16  * The Catalog.pm module reads this file and derives schema
17  * information.
18  *
19  *-------------------------------------------------------------------------
20  */
21 #ifndef PG_REWRITE_H
22 #define PG_REWRITE_H
23 
24 #include "catalog/genbki.h"
25 #include "catalog/pg_rewrite_d.h"
26 
27 /* ----------------
28  * pg_rewrite definition. cpp turns this into
29  * typedef struct FormData_pg_rewrite
30  * ----------------
31  */
32 CATALOG(pg_rewrite,2618,RewriteRelationId)
33 {
34  Oid oid; /* oid */
35  NameData rulename;
36  Oid ev_class BKI_LOOKUP(pg_class);
37  char ev_type;
38  char ev_enabled;
39  bool is_instead;
40 
41 #ifdef CATALOG_VARLEN /* variable-length fields start here */
42  pg_node_tree ev_qual BKI_FORCE_NOT_NULL;
43  pg_node_tree ev_action BKI_FORCE_NOT_NULL;
44 #endif
46 
47 /* ----------------
48  * Form_pg_rewrite corresponds to a pointer to a tuple with
49  * the format of pg_rewrite relation.
50  * ----------------
51  */
53 
54 DECLARE_TOAST(pg_rewrite, 2838, 2839);
55 
56 DECLARE_UNIQUE_INDEX_PKEY(pg_rewrite_oid_index, 2692, RewriteOidIndexId, pg_rewrite, btree(oid oid_ops));
57 DECLARE_UNIQUE_INDEX(pg_rewrite_rel_rulename_index, 2693, RewriteRelRulenameIndexId, pg_rewrite, btree(ev_class oid_ops, rulename name_ops));
58 
59 MAKE_SYSCACHE(RULERELNAME, pg_rewrite_rel_rulename_index, 8);
60 
61 #endif /* PG_REWRITE_H */
#define BKI_LOOKUP(catalog)
Definition: genbki.h:46
#define BKI_FORCE_NOT_NULL
Definition: genbki.h:33
DECLARE_UNIQUE_INDEX_PKEY(pg_rewrite_oid_index, 2692, RewriteOidIndexId, pg_rewrite, btree(oid oid_ops))
FormData_pg_rewrite
Definition: pg_rewrite.h:45
MAKE_SYSCACHE(RULERELNAME, pg_rewrite_rel_rulename_index, 8)
DECLARE_UNIQUE_INDEX(pg_rewrite_rel_rulename_index, 2693, RewriteRelRulenameIndexId, pg_rewrite, btree(ev_class oid_ops, rulename name_ops))
CATALOG(pg_rewrite, 2618, RewriteRelationId)
Definition: pg_rewrite.h:32
DECLARE_TOAST(pg_rewrite, 2838, 2839)
FormData_pg_rewrite * Form_pg_rewrite
Definition: pg_rewrite.h:52
unsigned int Oid
Definition: postgres_ext.h:31
Definition: c.h:741