pg_policy.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*-------------------------------------------------------------------------
  2. *
  3. * pg_policy.h
  4. * definition of the "policy" system catalog (pg_policy)
  5. *
  6. *
  7. * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
  8. * Portions Copyright (c) 1994, Regents of the University of California
  9. *
  10. * src/include/catalog/pg_policy.h
  11. *
  12. * NOTES
  13. * The Catalog.pm module reads this file and derives schema
  14. * information.
  15. *
  16. *-------------------------------------------------------------------------
  17. */
  18. #ifndef PG_POLICY_H
  19. #define PG_POLICY_H
  20. #include "catalog/genbki.h"
  21. #include "catalog/pg_policy_d.h"
  22. /* ----------------
  23. * pg_policy definition. cpp turns this into
  24. * typedef struct FormData_pg_policy
  25. * ----------------
  26. */
  27. CATALOG(pg_policy,3256,PolicyRelationId)
  28. {
  29. Oid oid; /* oid */
  30. NameData polname; /* Policy name. */
  31. Oid polrelid BKI_LOOKUP(pg_class); /* Oid of the relation with
  32. * policy. */
  33. char polcmd; /* One of ACL_*_CHR, or '*' for all */
  34. bool polpermissive; /* restrictive or permissive policy */
  35. #ifdef CATALOG_VARLEN
  36. /* Roles to which the policy is applied; zero means PUBLIC */
  37. Oid polroles[1] BKI_LOOKUP_OPT(pg_authid) BKI_FORCE_NOT_NULL;
  38. pg_node_tree polqual; /* Policy quals. */
  39. pg_node_tree polwithcheck; /* WITH CHECK quals. */
  40. #endif
  41. } FormData_pg_policy;
  42. /* ----------------
  43. * Form_pg_policy corresponds to a pointer to a row with
  44. * the format of pg_policy relation.
  45. * ----------------
  46. */
  47. typedef FormData_pg_policy *Form_pg_policy;
  48. DECLARE_TOAST(pg_policy, 4167, 4168);
  49. DECLARE_UNIQUE_INDEX_PKEY(pg_policy_oid_index, 3257, PolicyOidIndexId, on pg_policy using btree(oid oid_ops));
  50. DECLARE_UNIQUE_INDEX(pg_policy_polrelid_polname_index, 3258, PolicyPolrelidPolnameIndexId, on pg_policy using btree(polrelid oid_ops, polname name_ops));
  51. #endif /* PG_POLICY_H */