50.42. pg_range

The catalog pg_range stores information about range types. This is in addition to the types' entries in pg_type.

Table 50.42. pg_range Columns

NameTypeReferencesDescription
rngtypidoidpg_type.oidOID of the range type
rngsubtypeoidpg_type.oidOID of the element type (subtype) of this range type
rngcollationoidpg_collation.oidOID of the collation used for range comparisons, or 0 if none
rngsubopcoidpg_opclass.oidOID of the subtype's operator class used for range comparisons
rngcanonicalregprocpg_proc.oidOID of the function to convert a range value into canonical form, or 0 if none
rngsubdiffregprocpg_proc.oidOID of the function to return the difference between two element values as double precision, or 0 if none

rngsubopc (plus rngcollation, if the element type is collatable) determines the sort ordering used by the range type. rngcanonical is used when the element type is discrete. rngsubdiff is optional but should be supplied to improve performance of GiST indexes on the range type.