pg_operator.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*-------------------------------------------------------------------------
  2. *
  3. * pg_operator.h
  4. * definition of the "operator" system catalog (pg_operator)
  5. *
  6. *
  7. * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
  8. * Portions Copyright (c) 1994, Regents of the University of California
  9. *
  10. * src/include/catalog/pg_operator.h
  11. *
  12. * NOTES
  13. * The Catalog.pm module reads this file and derives schema
  14. * information.
  15. *
  16. *-------------------------------------------------------------------------
  17. */
  18. #ifndef PG_OPERATOR_H
  19. #define PG_OPERATOR_H
  20. #include "catalog/genbki.h"
  21. #include "catalog/objectaddress.h"
  22. #include "catalog/pg_operator_d.h"
  23. #include "nodes/pg_list.h"
  24. /* ----------------
  25. * pg_operator definition. cpp turns this into
  26. * typedef struct FormData_pg_operator
  27. * ----------------
  28. */
  29. CATALOG(pg_operator,2617,OperatorRelationId)
  30. {
  31. Oid oid; /* oid */
  32. /* name of operator */
  33. NameData oprname;
  34. /* OID of namespace containing this oper */
  35. Oid oprnamespace BKI_DEFAULT(pg_catalog) BKI_LOOKUP(pg_namespace);
  36. /* operator owner */
  37. Oid oprowner BKI_DEFAULT(POSTGRES) BKI_LOOKUP(pg_authid);
  38. /* 'l' for prefix or 'b' for infix */
  39. char oprkind BKI_DEFAULT(b);
  40. /* can be used in merge join? */
  41. bool oprcanmerge BKI_DEFAULT(f);
  42. /* can be used in hash join? */
  43. bool oprcanhash BKI_DEFAULT(f);
  44. /* left arg type, or 0 if prefix operator */
  45. Oid oprleft BKI_LOOKUP_OPT(pg_type);
  46. /* right arg type */
  47. Oid oprright BKI_LOOKUP(pg_type);
  48. /* result datatype; can be 0 in a "shell" operator */
  49. Oid oprresult BKI_LOOKUP_OPT(pg_type);
  50. /* OID of commutator oper, or 0 if none */
  51. Oid oprcom BKI_DEFAULT(0) BKI_LOOKUP_OPT(pg_operator);
  52. /* OID of negator oper, or 0 if none */
  53. Oid oprnegate BKI_DEFAULT(0) BKI_LOOKUP_OPT(pg_operator);
  54. /* OID of underlying function; can be 0 in a "shell" operator */
  55. regproc oprcode BKI_LOOKUP_OPT(pg_proc);
  56. /* OID of restriction estimator, or 0 */
  57. regproc oprrest BKI_DEFAULT(-) BKI_LOOKUP_OPT(pg_proc);
  58. /* OID of join estimator, or 0 */
  59. regproc oprjoin BKI_DEFAULT(-) BKI_LOOKUP_OPT(pg_proc);
  60. } FormData_pg_operator;
  61. /* ----------------
  62. * Form_pg_operator corresponds to a pointer to a tuple with
  63. * the format of pg_operator relation.
  64. * ----------------
  65. */
  66. typedef FormData_pg_operator *Form_pg_operator;
  67. DECLARE_UNIQUE_INDEX_PKEY(pg_operator_oid_index, 2688, OperatorOidIndexId, on pg_operator using btree(oid oid_ops));
  68. DECLARE_UNIQUE_INDEX(pg_operator_oprname_l_r_n_index, 2689, OperatorNameNspIndexId, on pg_operator using btree(oprname name_ops, oprleft oid_ops, oprright oid_ops, oprnamespace oid_ops));
  69. extern ObjectAddress OperatorCreate(const char *operatorName,
  70. Oid operatorNamespace,
  71. Oid leftTypeId,
  72. Oid rightTypeId,
  73. Oid procedureId,
  74. List *commutatorName,
  75. List *negatorName,
  76. Oid restrictionId,
  77. Oid joinId,
  78. bool canMerge,
  79. bool canHash);
  80. extern ObjectAddress makeOperatorDependencies(HeapTuple tuple,
  81. bool makeExtensionDep,
  82. bool isUpdate);
  83. extern void OperatorUpd(Oid baseId, Oid commId, Oid negId, bool isDelete);
  84. #endif /* PG_OPERATOR_H */