pg_range.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*-------------------------------------------------------------------------
  2. *
  3. * pg_range.h
  4. * definition of the system "range" relation (pg_range)
  5. * along with the relation's initial contents.
  6. *
  7. *
  8. * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
  9. * Portions Copyright (c) 1994, Regents of the University of California
  10. *
  11. * src/include/catalog/pg_range.h
  12. *
  13. * NOTES
  14. * the genbki.pl script reads this file and generates .bki
  15. * information from the DATA() statements.
  16. *
  17. * XXX do NOT break up DATA() statements into multiple lines!
  18. * the scripts are not as smart as you might think...
  19. *
  20. *-------------------------------------------------------------------------
  21. */
  22. #ifndef PG_RANGE_H
  23. #define PG_RANGE_H
  24. #include "catalog/genbki.h"
  25. /* ----------------
  26. * pg_range definition. cpp turns this into
  27. * typedef struct FormData_pg_range
  28. * ----------------
  29. */
  30. #define RangeRelationId 3541
  31. CATALOG(pg_range,3541) BKI_WITHOUT_OIDS
  32. {
  33. Oid rngtypid; /* OID of owning range type */
  34. Oid rngsubtype; /* OID of range's element type (subtype) */
  35. Oid rngcollation; /* collation for this range type, or 0 */
  36. Oid rngsubopc; /* subtype's btree opclass */
  37. regproc rngcanonical; /* canonicalize range, or 0 */
  38. regproc rngsubdiff; /* subtype difference as a float8, or 0 */
  39. } FormData_pg_range;
  40. /* ----------------
  41. * Form_pg_range corresponds to a pointer to a tuple with
  42. * the format of pg_range relation.
  43. * ----------------
  44. */
  45. typedef FormData_pg_range *Form_pg_range;
  46. /* ----------------
  47. * compiler constants for pg_range
  48. * ----------------
  49. */
  50. #define Natts_pg_range 6
  51. #define Anum_pg_range_rngtypid 1
  52. #define Anum_pg_range_rngsubtype 2
  53. #define Anum_pg_range_rngcollation 3
  54. #define Anum_pg_range_rngsubopc 4
  55. #define Anum_pg_range_rngcanonical 5
  56. #define Anum_pg_range_rngsubdiff 6
  57. /* ----------------
  58. * initial contents of pg_range
  59. * ----------------
  60. */
  61. DATA(insert ( 3904 23 0 1978 int4range_canonical int4range_subdiff));
  62. DATA(insert ( 3906 1700 0 3125 - numrange_subdiff));
  63. DATA(insert ( 3908 1114 0 3128 - tsrange_subdiff));
  64. DATA(insert ( 3910 1184 0 3127 - tstzrange_subdiff));
  65. DATA(insert ( 3912 1082 0 3122 daterange_canonical daterange_subdiff));
  66. DATA(insert ( 3926 20 0 3124 int8range_canonical int8range_subdiff));
  67. /*
  68. * prototypes for functions in pg_range.c
  69. */
  70. extern void RangeCreate(Oid rangeTypeOid, Oid rangeSubType, Oid rangeCollation,
  71. Oid rangeSubOpclass, RegProcedure rangeCanonical,
  72. RegProcedure rangeSubDiff);
  73. extern void RangeDelete(Oid rangeTypeOid);
  74. #endif /* PG_RANGE_H */