pg_default_acl.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*-------------------------------------------------------------------------
  2. *
  3. * pg_default_acl.h
  4. * definition of the system catalog for default ACLs of new objects
  5. * (pg_default_acl)
  6. *
  7. *
  8. * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
  9. * Portions Copyright (c) 1994, Regents of the University of California
  10. *
  11. * src/include/catalog/pg_default_acl.h
  12. *
  13. * NOTES
  14. * The Catalog.pm module reads this file and derives schema
  15. * information.
  16. *
  17. *-------------------------------------------------------------------------
  18. */
  19. #ifndef PG_DEFAULT_ACL_H
  20. #define PG_DEFAULT_ACL_H
  21. #include "catalog/genbki.h"
  22. #include "catalog/pg_default_acl_d.h"
  23. /* ----------------
  24. * pg_default_acl definition. cpp turns this into
  25. * typedef struct FormData_pg_default_acl
  26. * ----------------
  27. */
  28. CATALOG(pg_default_acl,826,DefaultAclRelationId)
  29. {
  30. Oid oid; /* oid */
  31. Oid defaclrole BKI_LOOKUP(pg_authid); /* OID of role owning this
  32. * ACL */
  33. Oid defaclnamespace BKI_LOOKUP_OPT(pg_namespace); /* OID of namespace, or
  34. * 0 for all */
  35. char defaclobjtype; /* see DEFACLOBJ_xxx constants below */
  36. #ifdef CATALOG_VARLEN /* variable-length fields start here */
  37. aclitem defaclacl[1] BKI_FORCE_NOT_NULL; /* permissions to add at
  38. * CREATE time */
  39. #endif
  40. } FormData_pg_default_acl;
  41. /* ----------------
  42. * Form_pg_default_acl corresponds to a pointer to a tuple with
  43. * the format of pg_default_acl relation.
  44. * ----------------
  45. */
  46. typedef FormData_pg_default_acl *Form_pg_default_acl;
  47. DECLARE_TOAST(pg_default_acl, 4143, 4144);
  48. DECLARE_UNIQUE_INDEX(pg_default_acl_role_nsp_obj_index, 827, DefaultAclRoleNspObjIndexId, on pg_default_acl using btree(defaclrole oid_ops, defaclnamespace oid_ops, defaclobjtype char_ops));
  49. DECLARE_UNIQUE_INDEX_PKEY(pg_default_acl_oid_index, 828, DefaultAclOidIndexId, on pg_default_acl using btree(oid oid_ops));
  50. #ifdef EXPOSE_TO_CLIENT_CODE
  51. /*
  52. * Types of objects for which the user is allowed to specify default
  53. * permissions through pg_default_acl. These codes are used in the
  54. * defaclobjtype column.
  55. */
  56. #define DEFACLOBJ_RELATION 'r' /* table, view */
  57. #define DEFACLOBJ_SEQUENCE 'S' /* sequence */
  58. #define DEFACLOBJ_FUNCTION 'f' /* function */
  59. #define DEFACLOBJ_TYPE 'T' /* type */
  60. #define DEFACLOBJ_NAMESPACE 'n' /* namespace */
  61. #endif /* EXPOSE_TO_CLIENT_CODE */
  62. #endif /* PG_DEFAULT_ACL_H */