select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Supported versions: Current (18) / 17 / 16 / 15 / 14
Development versions: 19 / devel
Unsupported versions: 13 / 12 / 11 / 10 / 9.6 / 9.5 / 9.4 / 9.3 / 9.2
Historical version. PostgreSQL 13 reached end of support in November 2025. See the current version for supported releases.

51.41. pg_range

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

Table 51.41. pg_range Columns

Column Type

Description

rngtypid oid (references pg_type.oid)

OID of the range type

rngsubtype oid (references pg_type.oid)

OID of the element type (subtype) of this range type

rngcollation oid (references pg_collation.oid)

OID of the collation used for range comparisons, or 0 if none

rngsubopc oid (references pg_opclass.oid)

OID of the subtype's operator class used for range comparisons

rngcanonical regproc (references pg_proc.oid)

OID of the function to convert a range value into canonical form, or 0 if none

rngsubdiff regproc (references pg_proc.oid)

OID 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.

Report a documentation issue

Read the upstream documentation. For corrections, first check the current version.