pg_database.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*-------------------------------------------------------------------------
  2. *
  3. * pg_database.h
  4. * definition of the system "database" relation (pg_database)
  5. * along with the relation's initial contents.
  6. *
  7. *
  8. * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
  9. * Portions Copyright (c) 1994, Regents of the University of California
  10. *
  11. * src/include/catalog/pg_database.h
  12. *
  13. * NOTES
  14. * the genbki.pl script reads this file and generates .bki
  15. * information from the DATA() statements.
  16. *
  17. *-------------------------------------------------------------------------
  18. */
  19. #ifndef PG_DATABASE_H
  20. #define PG_DATABASE_H
  21. #include "catalog/genbki.h"
  22. /* ----------------
  23. * pg_database definition. cpp turns this into
  24. * typedef struct FormData_pg_database
  25. * ----------------
  26. */
  27. #define DatabaseRelationId 1262
  28. #define DatabaseRelation_Rowtype_Id 1248
  29. CATALOG(pg_database,1262) BKI_SHARED_RELATION BKI_ROWTYPE_OID(1248) BKI_SCHEMA_MACRO
  30. {
  31. NameData datname; /* database name */
  32. Oid datdba; /* owner of database */
  33. int32 encoding; /* character encoding */
  34. NameData datcollate; /* LC_COLLATE setting */
  35. NameData datctype; /* LC_CTYPE setting */
  36. bool datistemplate; /* allowed as CREATE DATABASE template? */
  37. bool datallowconn; /* new connections allowed? */
  38. int32 datconnlimit; /* max connections allowed (-1=no limit) */
  39. Oid datlastsysoid; /* highest OID to consider a system OID */
  40. TransactionId datfrozenxid; /* all Xids < this are frozen in this DB */
  41. TransactionId datminmxid; /* all multixacts in the DB are >= this */
  42. Oid dattablespace; /* default table space for this DB */
  43. #ifdef CATALOG_VARLEN /* variable-length fields start here */
  44. aclitem datacl[1]; /* access permissions */
  45. #endif
  46. } FormData_pg_database;
  47. /* ----------------
  48. * Form_pg_database corresponds to a pointer to a tuple with
  49. * the format of pg_database relation.
  50. * ----------------
  51. */
  52. typedef FormData_pg_database *Form_pg_database;
  53. /* ----------------
  54. * compiler constants for pg_database
  55. * ----------------
  56. */
  57. #define Natts_pg_database 13
  58. #define Anum_pg_database_datname 1
  59. #define Anum_pg_database_datdba 2
  60. #define Anum_pg_database_encoding 3
  61. #define Anum_pg_database_datcollate 4
  62. #define Anum_pg_database_datctype 5
  63. #define Anum_pg_database_datistemplate 6
  64. #define Anum_pg_database_datallowconn 7
  65. #define Anum_pg_database_datconnlimit 8
  66. #define Anum_pg_database_datlastsysoid 9
  67. #define Anum_pg_database_datfrozenxid 10
  68. #define Anum_pg_database_datminmxid 11
  69. #define Anum_pg_database_dattablespace 12
  70. #define Anum_pg_database_datacl 13
  71. DATA(insert OID = 1 ( template1 PGUID ENCODING "LC_COLLATE" "LC_CTYPE" t t -1 0 0 1 1663 _null_));
  72. SHDESCR("default template for new databases");
  73. #define TemplateDbOid 1
  74. #endif /* PG_DATABASE_H */