pg_range.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*-------------------------------------------------------------------------
  2. *
  3. * pg_range.h
  4. * definition of the "range type" system catalog (pg_range)
  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_range.h
  11. *
  12. * NOTES
  13. * The Catalog.pm module reads this file and derives schema
  14. * information.
  15. *
  16. *-------------------------------------------------------------------------
  17. */
  18. #ifndef PG_RANGE_H
  19. #define PG_RANGE_H
  20. #include "catalog/genbki.h"
  21. #include "catalog/pg_range_d.h"
  22. /* ----------------
  23. * pg_range definition. cpp turns this into
  24. * typedef struct FormData_pg_range
  25. * ----------------
  26. */
  27. CATALOG(pg_range,3541,RangeRelationId)
  28. {
  29. /* OID of owning range type */
  30. Oid rngtypid BKI_LOOKUP(pg_type);
  31. /* OID of range's element type (subtype) */
  32. Oid rngsubtype BKI_LOOKUP(pg_type);
  33. /* OID of the range's multirange type */
  34. Oid rngmultitypid BKI_LOOKUP(pg_type);
  35. /* collation for this range type, or 0 */
  36. Oid rngcollation BKI_DEFAULT(0) BKI_LOOKUP_OPT(pg_collation);
  37. /* subtype's btree opclass */
  38. Oid rngsubopc BKI_LOOKUP(pg_opclass);
  39. /* canonicalize range, or 0 */
  40. regproc rngcanonical BKI_LOOKUP_OPT(pg_proc);
  41. /* subtype difference as a float8, or 0 */
  42. regproc rngsubdiff BKI_LOOKUP_OPT(pg_proc);
  43. } FormData_pg_range;
  44. /* ----------------
  45. * Form_pg_range corresponds to a pointer to a tuple with
  46. * the format of pg_range relation.
  47. * ----------------
  48. */
  49. typedef FormData_pg_range *Form_pg_range;
  50. DECLARE_UNIQUE_INDEX_PKEY(pg_range_rngtypid_index, 3542, RangeTypidIndexId, on pg_range using btree(rngtypid oid_ops));
  51. DECLARE_UNIQUE_INDEX(pg_range_rngmultitypid_index, 2228, RangeMultirangeTypidIndexId, on pg_range using btree(rngmultitypid oid_ops));
  52. /*
  53. * prototypes for functions in pg_range.c
  54. */
  55. extern void RangeCreate(Oid rangeTypeOid, Oid rangeSubType, Oid rangeCollation,
  56. Oid rangeSubOpclass, RegProcedure rangeCanonical,
  57. RegProcedure rangeSubDiff, Oid multirangeTypeOid);
  58. extern void RangeDelete(Oid rangeTypeOid);
  59. #endif /* PG_RANGE_H */