pg_range

A system catalogue table storing information about range types

pg_range is a system catalogue table storing information about range types, expanding on their base entry in pg_type.

pg_range was added in PostgreSQL 9.2 (commit 4429f6a9).

Change history

This table has not been modified since it was added in PostgreSQL 9.2.

Examples

Default table contents:

postgres=# SELECT * FROM pg_range;
 rngtypid | rngsubtype | rngcollation | rngsubopc |    rngcanonical     |    rngsubdiff     
----------+------------+--------------+-----------+---------------------+-------------------
     3904 |         23 |            0 |      1978 | int4range_canonical | int4range_subdiff
     3906 |       1700 |            0 |      3125 | -                   | numrange_subdiff
     3908 |       1114 |            0 |      3128 | -                   | tsrange_subdiff
     3910 |       1184 |            0 |      3127 | -                   | tstzrange_subdiff
     3912 |       1082 |            0 |      3122 | daterange_canonical | daterange_subdiff
     3926 |         20 |            0 |      3124 | int8range_canonical | int8range_subdiff
(6 rows)

Details of the daterange range type together with the matching row from pg_type:

postgres=# SELECT t.*, r.* FROM pg_type t JOIN pg_range r ON r.rngtypid = t.oid WHERE typname='daterange';
-[ RECORD 1 ]--+--------------------
typname        | daterange
typnamespace   | 11
typowner       | 10
typlen         | -1
typbyval       | f
typtype        | r
typcategory    | R
typispreferred | f
typisdefined   | t
typdelim       | ,
typrelid       | 0
typelem        | 0
typarray       | 3913
typinput       | range_in
typoutput      | range_out
typreceive     | range_recv
typsend        | range_send
typmodin       | -
typmodout      | -
typanalyze     | range_typanalyze
typalign       | i
typstorage     | x
typnotnull     | f
typbasetype    | 0
typtypmod      | -1
typndims       | 0
typcollation   | 0
typdefaultbin  | 
typdefault     | 
typacl         | 
rngtypid       | 3912
rngsubtype     | 1082
rngcollation   | 0
rngsubopc      | 3122
rngcanonical   | daterange_canonical
rngsubdiff     | daterange_subdiff

Categories

Data type, System catalogue

See also

range type, pg_type