1 /*
2  * pg_policy.h
3  *	 definition of the system "policy" relation (pg_policy)
4  *
5  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
6  * Portions Copyright (c) 1994, Regents of the University of California
7  *
8  */
9 #ifndef PG_POLICY_H
10 #define PG_POLICY_H
11 
12 #include "catalog/genbki.h"
13 
14 /* ----------------
15  *		pg_policy definition. cpp turns this into
16  *		typedef struct FormData_pg_policy
17  * ----------------
18  */
19 #define PolicyRelationId	3256
20 
21 CATALOG(pg_policy,3256)
22 {
23 	NameData	polname;		/* Policy name. */
24 	Oid			polrelid;		/* Oid of the relation with policy. */
25 	char		polcmd;			/* One of ACL_*_CHR, or '*' for all */
26 	bool		polpermissive;	/* restrictive or permissive policy */
27 
28 #ifdef CATALOG_VARLEN
29 	Oid			polroles[1];	/* Roles associated with policy, not-NULL */
30 	pg_node_tree polqual;		/* Policy quals. */
31 	pg_node_tree polwithcheck;	/* WITH CHECK quals. */
32 #endif
33 } FormData_pg_policy;
34 
35 /* ----------------
36  *		Form_pg_policy corresponds to a pointer to a row with
37  *		the format of pg_policy relation.
38  * ----------------
39  */
40 typedef FormData_pg_policy *Form_pg_policy;
41 
42 /* ----------------
43  *		compiler constants for pg_policy
44  * ----------------
45  */
46 #define Natts_pg_policy					7
47 #define Anum_pg_policy_polname			1
48 #define Anum_pg_policy_polrelid			2
49 #define Anum_pg_policy_polcmd			3
50 #define Anum_pg_policy_polpermissive	4
51 #define Anum_pg_policy_polroles			5
52 #define Anum_pg_policy_polqual			6
53 #define Anum_pg_policy_polwithcheck		7
54 
55 #endif							/* PG_POLICY_H */
56