pg_description.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*-------------------------------------------------------------------------
  2. *
  3. * pg_description.h
  4. * definition of the "description" system catalog (pg_description)
  5. *
  6. * Because the contents of this table are taken from the *.dat files
  7. * of other catalogs, there is no pg_description.dat file. The initial
  8. * contents are assembled by genbki.pl and loaded during initdb.
  9. *
  10. * NOTE: an object is identified by the OID of the row that primarily
  11. * defines the object, plus the OID of the table that that row appears in.
  12. * For example, a function is identified by the OID of its pg_proc row
  13. * plus the pg_class OID of table pg_proc. This allows unique identification
  14. * of objects without assuming that OIDs are unique across tables.
  15. *
  16. * Since attributes don't have OIDs of their own, we identify an attribute
  17. * comment by the objoid+classoid of its parent table, plus an "objsubid"
  18. * giving the attribute column number. "objsubid" must be zero in a comment
  19. * for a table itself, so that it is distinct from any column comment.
  20. * Currently, objsubid is unused and zero for all other kinds of objects,
  21. * but perhaps it might be useful someday to associate comments with
  22. * constituent elements of other kinds of objects (arguments of a function,
  23. * for example).
  24. *
  25. *
  26. * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
  27. * Portions Copyright (c) 1994, Regents of the University of California
  28. *
  29. * src/include/catalog/pg_description.h
  30. *
  31. * NOTES
  32. * The Catalog.pm module reads this file and derives schema
  33. * information.
  34. *
  35. *-------------------------------------------------------------------------
  36. */
  37. #ifndef PG_DESCRIPTION_H
  38. #define PG_DESCRIPTION_H
  39. #include "catalog/genbki.h"
  40. #include "catalog/pg_description_d.h"
  41. /* ----------------
  42. * pg_description definition. cpp turns this into
  43. * typedef struct FormData_pg_description
  44. * ----------------
  45. */
  46. CATALOG(pg_description,2609,DescriptionRelationId)
  47. {
  48. Oid objoid; /* OID of object itself */
  49. Oid classoid; /* OID of table containing object */
  50. int32 objsubid; /* column number, or 0 if not used */
  51. #ifdef CATALOG_VARLEN /* variable-length fields start here */
  52. text description BKI_FORCE_NOT_NULL; /* description of object */
  53. #endif
  54. } FormData_pg_description;
  55. /* ----------------
  56. * Form_pg_description corresponds to a pointer to a tuple with
  57. * the format of pg_description relation.
  58. * ----------------
  59. */
  60. typedef FormData_pg_description * Form_pg_description;
  61. DECLARE_TOAST(pg_description, 2834, 2835);
  62. DECLARE_UNIQUE_INDEX_PKEY(pg_description_o_c_o_index, 2675, DescriptionObjIndexId, on pg_description using btree(objoid oid_ops, classoid oid_ops, objsubid int4_ops));
  63. /* We do not use BKI_LOOKUP here because it causes problems for genbki.pl */
  64. DECLARE_FOREIGN_KEY((classoid), pg_class, (oid));
  65. #endif /* PG_DESCRIPTION_H */