pg_range — PostgreSQL system catalog

The PostgreSQL pg_range system catalog: full column reference (names, types, descriptions), catalog relationships and version support.

Summary

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

(Description quoted from the official PostgreSQL documentation.)

Columns

The pg_range system catalog exposes the following columns (names, types and descriptions are taken verbatim from the PostgreSQL documentation):

  • 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
  • rngmultitypid oid references pg_type.oid
    OID of the multirange type for this range type
  • rngcollation oid references pg_collation.oid
    OID of the collation used for range comparisons, or zero if none
  • rngsubopc oid references pg_opclass.oid
    OID of the subtype’s operator class used for range comparisons
  • rngconstruct2 regproc references pg_proc.oid
    OID of the 2-argument range constructor function (lower and upper)
  • rngconstruct3 regproc references pg_proc.oid
    OID of the 3-argument range constructor function (lower, upper, and flags)
  • rngmltconstruct0 regproc references pg_proc.oid
    OID of the 0-argument multirange constructor function (constructs empty range)
  • rngmltconstruct1 regproc references pg_proc.oid
    OID of the 1-argument multirange constructor function (constructs multirange from single range, also used as cast function)
  • rngmltconstruct2 regproc references pg_proc.oid
    OID of the 2-argument multirange constructor function (constructs multirange from array of ranges)
  • rngcanonical regproc references pg_proc.oid
    OID of the function to convert a range value into canonical form, or zero if none
  • rngsubdiff regproc references pg_proc.oid
    OID of the function to return the difference between two element values as double precision, or zero if none

Related catalogs

This object references the following other system catalogs:

Version applicability

Present in PostgreSQL 17, 18, 19 (verified against each release’s documentation). This is a long-standing system object that also exists in earlier PostgreSQL releases.

Related & references

Reference: PostgreSQL documentation — pg_range.