pg_rewrite.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*-------------------------------------------------------------------------
  2. *
  3. * pg_rewrite.h
  4. * definition of the "rewrite rule" system catalog (pg_rewrite)
  5. *
  6. * As of Postgres 7.3, the primary key for this table is <ev_class, rulename>
  7. * --- ie, rule names are only unique among the rules of a given table.
  8. *
  9. *
  10. * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
  11. * Portions Copyright (c) 1994, Regents of the University of California
  12. *
  13. * src/include/catalog/pg_rewrite.h
  14. *
  15. * NOTES
  16. * The Catalog.pm module reads this file and derives schema
  17. * information.
  18. *
  19. *-------------------------------------------------------------------------
  20. */
  21. #ifndef PG_REWRITE_H
  22. #define PG_REWRITE_H
  23. #include "catalog/genbki.h"
  24. #include "catalog/pg_rewrite_d.h"
  25. /* ----------------
  26. * pg_rewrite definition. cpp turns this into
  27. * typedef struct FormData_pg_rewrite
  28. * ----------------
  29. */
  30. CATALOG(pg_rewrite,2618,RewriteRelationId)
  31. {
  32. Oid oid; /* oid */
  33. NameData rulename;
  34. Oid ev_class BKI_LOOKUP(pg_class);
  35. char ev_type;
  36. char ev_enabled;
  37. bool is_instead;
  38. #ifdef CATALOG_VARLEN /* variable-length fields start here */
  39. pg_node_tree ev_qual BKI_FORCE_NOT_NULL;
  40. pg_node_tree ev_action BKI_FORCE_NOT_NULL;
  41. #endif
  42. } FormData_pg_rewrite;
  43. /* ----------------
  44. * Form_pg_rewrite corresponds to a pointer to a tuple with
  45. * the format of pg_rewrite relation.
  46. * ----------------
  47. */
  48. typedef FormData_pg_rewrite *Form_pg_rewrite;
  49. DECLARE_TOAST(pg_rewrite, 2838, 2839);
  50. DECLARE_UNIQUE_INDEX_PKEY(pg_rewrite_oid_index, 2692, RewriteOidIndexId, on pg_rewrite using btree(oid oid_ops));
  51. DECLARE_UNIQUE_INDEX(pg_rewrite_rel_rulename_index, 2693, RewriteRelRulenameIndexId, on pg_rewrite using btree(ev_class oid_ops, rulename name_ops));
  52. #endif /* PG_REWRITE_H */