Header And Logo

PostgreSQL
| The world's most advanced open source database.

pg_range.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * pg_range.h
00004  *    definition of the system "range" relation (pg_range)
00005  *    along with the relation's initial contents.
00006  *
00007  *
00008  * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
00009  * Portions Copyright (c) 1994, Regents of the University of California
00010  *
00011  * src/include/catalog/pg_range.h
00012  *
00013  * NOTES
00014  *    the genbki.pl script reads this file and generates .bki
00015  *    information from the DATA() statements.
00016  *
00017  *    XXX do NOT break up DATA() statements into multiple lines!
00018  *        the scripts are not as smart as you might think...
00019  *
00020  *-------------------------------------------------------------------------
00021  */
00022 #ifndef PG_RANGE_H
00023 #define PG_RANGE_H
00024 
00025 #include "catalog/genbki.h"
00026 
00027 /* ----------------
00028  *      pg_range definition.  cpp turns this into
00029  *      typedef struct FormData_pg_range
00030  * ----------------
00031  */
00032 #define RangeRelationId 3541
00033 
00034 CATALOG(pg_range,3541) BKI_WITHOUT_OIDS
00035 {
00036     Oid         rngtypid;       /* OID of owning range type */
00037     Oid         rngsubtype;     /* OID of range's element type (subtype) */
00038     Oid         rngcollation;   /* collation for this range type, or 0 */
00039     Oid         rngsubopc;      /* subtype's btree opclass */
00040     regproc     rngcanonical;   /* canonicalize range, or 0 */
00041     regproc     rngsubdiff;     /* subtype difference as a float8, or 0 */
00042 } FormData_pg_range;
00043 
00044 /* ----------------
00045  *      Form_pg_range corresponds to a pointer to a tuple with
00046  *      the format of pg_range relation.
00047  * ----------------
00048  */
00049 typedef FormData_pg_range *Form_pg_range;
00050 
00051 /* ----------------
00052  *      compiler constants for pg_range
00053  * ----------------
00054  */
00055 #define Natts_pg_range                  6
00056 #define Anum_pg_range_rngtypid          1
00057 #define Anum_pg_range_rngsubtype        2
00058 #define Anum_pg_range_rngcollation      3
00059 #define Anum_pg_range_rngsubopc         4
00060 #define Anum_pg_range_rngcanonical      5
00061 #define Anum_pg_range_rngsubdiff        6
00062 
00063 
00064 /* ----------------
00065  *      initial contents of pg_range
00066  * ----------------
00067  */
00068 DATA(insert ( 3904 23   0 1978 int4range_canonical int4range_subdiff));
00069 DATA(insert ( 3906 1700 0 3125 - numrange_subdiff));
00070 DATA(insert ( 3908 1114 0 3128 - tsrange_subdiff));
00071 DATA(insert ( 3910 1184 0 3127 - tstzrange_subdiff));
00072 DATA(insert ( 3912 1082 0 3122 daterange_canonical daterange_subdiff));
00073 DATA(insert ( 3926 20   0 3124 int8range_canonical int8range_subdiff));
00074 
00075 
00076 /*
00077  * prototypes for functions in pg_range.c
00078  */
00079 
00080 extern void RangeCreate(Oid rangeTypeOid, Oid rangeSubType, Oid rangeCollation,
00081             Oid rangeSubOpclass, RegProcedure rangeCanonical,
00082             RegProcedure rangeSubDiff);
00083 extern void RangeDelete(Oid rangeTypeOid);
00084 
00085 #endif   /* PG_RANGE_H */