PostgreSQL Source Code git master
pg_range.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * pg_range.h
4 * definition of the "range type" system catalog (pg_range)
5 *
6 *
7 * Portions Copyright (c) 1996-2025, 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
21#include "catalog/genbki.h"
22#include "catalog/pg_range_d.h" /* IWYU pragma: export */
23
24/* ----------------
25 * pg_range definition. cpp turns this into
26 * typedef struct FormData_pg_range
27 * ----------------
28 */
29CATALOG(pg_range,3541,RangeRelationId)
30{
31 /* OID of owning range type */
32 Oid rngtypid BKI_LOOKUP(pg_type);
33
34 /* OID of range's element type (subtype) */
35 Oid rngsubtype BKI_LOOKUP(pg_type);
36
37 /* OID of the range's multirange type */
38 Oid rngmultitypid BKI_LOOKUP(pg_type);
39
40 /* collation for this range type, or 0 */
41 Oid rngcollation BKI_DEFAULT(0) BKI_LOOKUP_OPT(pg_collation);
42
43 /* subtype's btree opclass */
44 Oid rngsubopc BKI_LOOKUP(pg_opclass);
45
46 /* canonicalize range, or 0 */
47 regproc rngcanonical BKI_LOOKUP_OPT(pg_proc);
48
49 /* subtype difference as a float8, or 0 */
50 regproc rngsubdiff BKI_LOOKUP_OPT(pg_proc);
52
53/* ----------------
54 * Form_pg_range corresponds to a pointer to a tuple with
55 * the format of pg_range relation.
56 * ----------------
57 */
59
60DECLARE_UNIQUE_INDEX_PKEY(pg_range_rngtypid_index, 3542, RangeTypidIndexId, pg_range, btree(rngtypid oid_ops));
61DECLARE_UNIQUE_INDEX(pg_range_rngmultitypid_index, 2228, RangeMultirangeTypidIndexId, pg_range, btree(rngmultitypid oid_ops));
62
63MAKE_SYSCACHE(RANGETYPE, pg_range_rngtypid_index, 4);
64MAKE_SYSCACHE(RANGEMULTIRANGE, pg_range_rngmultitypid_index, 4);
65
66/*
67 * prototypes for functions in pg_range.c
68 */
69
70extern void RangeCreate(Oid rangeTypeOid, Oid rangeSubType, Oid rangeCollation,
71 Oid rangeSubOpclass, RegProcedure rangeCanonical,
72 RegProcedure rangeSubDiff, Oid multirangeTypeOid);
73extern void RangeDelete(Oid rangeTypeOid);
74
75#endif /* PG_RANGE_H */
Oid regproc
Definition: c.h:606
regproc RegProcedure
Definition: c.h:607
#define BKI_LOOKUP(catalog)
Definition: genbki.h:46
#define BKI_DEFAULT(value)
Definition: genbki.h:35
#define BKI_LOOKUP_OPT(catalog)
Definition: genbki.h:47
DECLARE_UNIQUE_INDEX_PKEY(pg_range_rngtypid_index, 3542, RangeTypidIndexId, pg_range, btree(rngtypid oid_ops))
CATALOG(pg_range, 3541, RangeRelationId)
Definition: pg_range.h:29
void RangeCreate(Oid rangeTypeOid, Oid rangeSubType, Oid rangeCollation, Oid rangeSubOpclass, RegProcedure rangeCanonical, RegProcedure rangeSubDiff, Oid multirangeTypeOid)
Definition: pg_range.c:36
FormData_pg_range
Definition: pg_range.h:51
MAKE_SYSCACHE(RANGETYPE, pg_range_rngtypid_index, 4)
void RangeDelete(Oid rangeTypeOid)
Definition: pg_range.c:113
DECLARE_UNIQUE_INDEX(pg_range_rngmultitypid_index, 2228, RangeMultirangeTypidIndexId, pg_range, btree(rngmultitypid oid_ops))
FormData_pg_range * Form_pg_range
Definition: pg_range.h:58
unsigned int Oid
Definition: postgres_ext.h:32