Header And Logo

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

Defines | Typedefs | Functions | Variables

pg_range.h File Reference

#include "catalog/genbki.h"
Include dependency graph for pg_range.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define RangeRelationId   3541
#define Natts_pg_range   6
#define Anum_pg_range_rngtypid   1
#define Anum_pg_range_rngsubtype   2
#define Anum_pg_range_rngcollation   3
#define Anum_pg_range_rngsubopc   4
#define Anum_pg_range_rngcanonical   5
#define Anum_pg_range_rngsubdiff   6

Typedefs

typedef FormData_pg_rangeForm_pg_range

Functions

 CATALOG (pg_range, 3541) BKI_WITHOUT_OIDS
 DATA (insert(3904 23 0 1978 int4range_canonical int4range_subdiff))
 DATA (insert(3906 1700 0 3125-numrange_subdiff))
 DATA (insert(3908 1114 0 3128-tsrange_subdiff))
 DATA (insert(3910 1184 0 3127-tstzrange_subdiff))
 DATA (insert(3912 1082 0 3122 daterange_canonical daterange_subdiff))
 DATA (insert(3926 20 0 3124 int8range_canonical int8range_subdiff))
void RangeCreate (Oid rangeTypeOid, Oid rangeSubType, Oid rangeCollation, Oid rangeSubOpclass, RegProcedure rangeCanonical, RegProcedure rangeSubDiff)
void RangeDelete (Oid rangeTypeOid)

Variables

 FormData_pg_range

Define Documentation

#define Anum_pg_range_rngcanonical   5

Definition at line 60 of file pg_range.h.

Referenced by RangeCreate().

#define Anum_pg_range_rngcollation   3

Definition at line 58 of file pg_range.h.

Referenced by RangeCreate().

#define Anum_pg_range_rngsubdiff   6

Definition at line 61 of file pg_range.h.

Referenced by RangeCreate().

#define Anum_pg_range_rngsubopc   4

Definition at line 59 of file pg_range.h.

Referenced by RangeCreate().

#define Anum_pg_range_rngsubtype   2

Definition at line 57 of file pg_range.h.

Referenced by RangeCreate().

#define Anum_pg_range_rngtypid   1

Definition at line 56 of file pg_range.h.

Referenced by RangeCreate(), and RangeDelete().

#define Natts_pg_range   6

Definition at line 55 of file pg_range.h.

#define RangeRelationId   3541

Definition at line 32 of file pg_range.h.

Referenced by RangeCreate(), and RangeDelete().


Typedef Documentation

Definition at line 49 of file pg_range.h.


Function Documentation

CATALOG ( pg_range  ,
3541   
)

Definition at line 34 of file pg_range.h.

{
    Oid         rngtypid;       /* OID of owning range type */
    Oid         rngsubtype;     /* OID of range's element type (subtype) */
    Oid         rngcollation;   /* collation for this range type, or 0 */
    Oid         rngsubopc;      /* subtype's btree opclass */
    regproc     rngcanonical;   /* canonicalize range, or 0 */
    regproc     rngsubdiff;     /* subtype difference as a float8, or 0 */
} FormData_pg_range;

DATA ( insert(3904 23 0 1978 int4range_canonical int4range_subdiff)   ) 
DATA ( insert(3908 1114 0 3128-tsrange_subdiff)   ) 
DATA ( insert(3926 20 0 3124 int8range_canonical int8range_subdiff)   ) 
DATA ( insert(3912 1082 0 3122 daterange_canonical daterange_subdiff)   ) 
DATA ( insert(3910 1184 0 3127-tstzrange_subdiff)   ) 
DATA ( insert(3906 1700 0 3125-numrange_subdiff)   ) 
void RangeCreate ( Oid  rangeTypeOid,
Oid  rangeSubType,
Oid  rangeCollation,
Oid  rangeSubOpclass,
RegProcedure  rangeCanonical,
RegProcedure  rangeSubDiff 
)

Definition at line 37 of file pg_range.c.

References Anum_pg_range_rngcanonical, Anum_pg_range_rngcollation, Anum_pg_range_rngsubdiff, Anum_pg_range_rngsubopc, Anum_pg_range_rngsubtype, Anum_pg_range_rngtypid, CatalogUpdateIndexes(), ObjectAddress::classId, DEPENDENCY_NORMAL, heap_close, heap_form_tuple(), heap_freetuple(), heap_open(), ObjectAddress::objectId, ObjectIdGetDatum, ObjectAddress::objectSubId, OidIsValid, RangeRelationId, recordDependencyOn(), RelationGetDescr, RowExclusiveLock, simple_heap_insert(), and values.

Referenced by DefineRange().

{
    Relation    pg_range;
    Datum       values[Natts_pg_range];
    bool        nulls[Natts_pg_range];
    HeapTuple   tup;
    ObjectAddress myself;
    ObjectAddress referenced;

    pg_range = heap_open(RangeRelationId, RowExclusiveLock);

    memset(nulls, 0, sizeof(nulls));

    values[Anum_pg_range_rngtypid - 1] = ObjectIdGetDatum(rangeTypeOid);
    values[Anum_pg_range_rngsubtype - 1] = ObjectIdGetDatum(rangeSubType);
    values[Anum_pg_range_rngcollation - 1] = ObjectIdGetDatum(rangeCollation);
    values[Anum_pg_range_rngsubopc - 1] = ObjectIdGetDatum(rangeSubOpclass);
    values[Anum_pg_range_rngcanonical - 1] = ObjectIdGetDatum(rangeCanonical);
    values[Anum_pg_range_rngsubdiff - 1] = ObjectIdGetDatum(rangeSubDiff);

    tup = heap_form_tuple(RelationGetDescr(pg_range), values, nulls);

    simple_heap_insert(pg_range, tup);
    CatalogUpdateIndexes(pg_range, tup);
    heap_freetuple(tup);

    /* record type's dependencies on range-related items */

    myself.classId = TypeRelationId;
    myself.objectId = rangeTypeOid;
    myself.objectSubId = 0;

    referenced.classId = TypeRelationId;
    referenced.objectId = rangeSubType;
    referenced.objectSubId = 0;
    recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);

    referenced.classId = OperatorClassRelationId;
    referenced.objectId = rangeSubOpclass;
    referenced.objectSubId = 0;
    recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);

    if (OidIsValid(rangeCollation))
    {
        referenced.classId = CollationRelationId;
        referenced.objectId = rangeCollation;
        referenced.objectSubId = 0;
        recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
    }

    if (OidIsValid(rangeCanonical))
    {
        referenced.classId = ProcedureRelationId;
        referenced.objectId = rangeCanonical;
        referenced.objectSubId = 0;
        recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
    }

    if (OidIsValid(rangeSubDiff))
    {
        referenced.classId = ProcedureRelationId;
        referenced.objectId = rangeSubDiff;
        referenced.objectSubId = 0;
        recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
    }

    heap_close(pg_range, RowExclusiveLock);
}

void RangeDelete ( Oid  rangeTypeOid  ) 

Variable Documentation

Definition at line 42 of file pg_range.h.