pg_amproc.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*-------------------------------------------------------------------------
  2. *
  3. * pg_amproc.h
  4. * definition of the "access method procedure" system catalog (pg_amproc)
  5. *
  6. * The amproc table identifies support procedures associated with index
  7. * operator families and classes. These procedures can't be listed in pg_amop
  8. * since they are not the implementation of any indexable operator.
  9. *
  10. * The primary key for this table is <amprocfamily, amproclefttype,
  11. * amprocrighttype, amprocnum>. The "default" support functions for a
  12. * particular opclass within the family are those with amproclefttype =
  13. * amprocrighttype = opclass's opcintype. These are the ones loaded into the
  14. * relcache for an index and typically used for internal index operations.
  15. * Other support functions are typically used to handle cross-type indexable
  16. * operators with oprleft/oprright matching the entry's amproclefttype and
  17. * amprocrighttype. The exact behavior depends on the index AM, however, and
  18. * some don't pay attention to non-default functions at all.
  19. *
  20. *
  21. * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
  22. * Portions Copyright (c) 1994, Regents of the University of California
  23. *
  24. * src/include/catalog/pg_amproc.h
  25. *
  26. * NOTES
  27. * The Catalog.pm module reads this file and derives schema
  28. * information.
  29. *
  30. *-------------------------------------------------------------------------
  31. */
  32. #ifndef PG_AMPROC_H
  33. #define PG_AMPROC_H
  34. #include "catalog/genbki.h"
  35. #include "catalog/pg_amproc_d.h"
  36. /* ----------------
  37. * pg_amproc definition. cpp turns this into
  38. * typedef struct FormData_pg_amproc
  39. * ----------------
  40. */
  41. CATALOG(pg_amproc,2603,AccessMethodProcedureRelationId)
  42. {
  43. Oid oid; /* oid */
  44. /* the index opfamily this entry is for */
  45. Oid amprocfamily BKI_LOOKUP(pg_opfamily);
  46. /* procedure's left input data type */
  47. Oid amproclefttype BKI_LOOKUP(pg_type);
  48. /* procedure's right input data type */
  49. Oid amprocrighttype BKI_LOOKUP(pg_type);
  50. /* support procedure index */
  51. int16 amprocnum;
  52. /* OID of the proc */
  53. regproc amproc BKI_LOOKUP(pg_proc);
  54. } FormData_pg_amproc;
  55. /* ----------------
  56. * Form_pg_amproc corresponds to a pointer to a tuple with
  57. * the format of pg_amproc relation.
  58. * ----------------
  59. */
  60. typedef FormData_pg_amproc *Form_pg_amproc;
  61. DECLARE_UNIQUE_INDEX(pg_amproc_fam_proc_index, 2655, AccessMethodProcedureIndexId, on pg_amproc using btree(amprocfamily oid_ops, amproclefttype oid_ops, amprocrighttype oid_ops, amprocnum int2_ops));
  62. DECLARE_UNIQUE_INDEX_PKEY(pg_amproc_oid_index, 2757, AccessMethodProcedureOidIndexId, on pg_amproc using btree(oid oid_ops));
  63. #endif /* PG_AMPROC_H */