pg_db_role_setting.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*-------------------------------------------------------------------------
  2. *
  3. * pg_db_role_setting.h
  4. * definition of the system catalog for per-database/per-user
  5. * configuration settings (pg_db_role_setting)
  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_db_role_setting.h
  12. *
  13. * NOTES
  14. * The Catalog.pm module reads this file and derives schema
  15. * information.
  16. *
  17. *-------------------------------------------------------------------------
  18. */
  19. #ifndef PG_DB_ROLE_SETTING_H
  20. #define PG_DB_ROLE_SETTING_H
  21. #include "catalog/genbki.h"
  22. #include "catalog/pg_db_role_setting_d.h"
  23. #include "utils/guc.h"
  24. #include "utils/relcache.h"
  25. #include "utils/snapshot.h"
  26. /* ----------------
  27. * pg_db_role_setting definition. cpp turns this into
  28. * typedef struct FormData_pg_db_role_setting
  29. * ----------------
  30. */
  31. CATALOG(pg_db_role_setting,2964,DbRoleSettingRelationId) BKI_SHARED_RELATION
  32. {
  33. /* database, or 0 for a role-specific setting */
  34. Oid setdatabase BKI_LOOKUP_OPT(pg_database);
  35. /* role, or 0 for a database-specific setting */
  36. Oid setrole BKI_LOOKUP_OPT(pg_authid);
  37. #ifdef CATALOG_VARLEN /* variable-length fields start here */
  38. text setconfig[1]; /* GUC settings to apply at login */
  39. #endif
  40. } FormData_pg_db_role_setting;
  41. typedef FormData_pg_db_role_setting * Form_pg_db_role_setting;
  42. DECLARE_TOAST_WITH_MACRO(pg_db_role_setting, 2966, 2967, PgDbRoleSettingToastTable, PgDbRoleSettingToastIndex);
  43. DECLARE_UNIQUE_INDEX_PKEY(pg_db_role_setting_databaseid_rol_index, 2965, DbRoleSettingDatidRolidIndexId, on pg_db_role_setting using btree(setdatabase oid_ops, setrole oid_ops));
  44. /*
  45. * prototypes for functions in pg_db_role_setting.h
  46. */
  47. extern void AlterSetting(Oid databaseid, Oid roleid, VariableSetStmt *setstmt);
  48. extern void DropSetting(Oid databaseid, Oid roleid);
  49. extern void ApplySetting(Snapshot snapshot, Oid databaseid, Oid roleid,
  50. Relation relsetting, GucSource source);
  51. #endif /* PG_DB_ROLE_SETTING_H */