Wiki / Data Types / Pseudo-types
anymultirange
Indicates that a function accepts any multirange data type (see Section 36.2.5 and Section 8.17 ).
Reading PostgreSQL 18.6.
PG10–20 core source inventory. Casts and operator classes show explicitly declared relationships; absent rows do not rule out coercions or indexing through other mechanisms.
Definition
Indicates that a function accepts any multirange data type (see Section 36.2.5 and Section 8.17 ).
anymultirange
- Catalog name
- pg_catalog.anymultirange
- Type OID
- 4537
- Type kind
- Pseudo-type
- Declared length
- Variable length (varlena)
- Storage strategy
- extended
- Input function
- anymultirange_in
- Output function
- anymultirange_out
- Documented declaration
- anymultirange
- Manual description
- Indicates that a function accepts any multirange data type (see Section 36.2.5 and Section 8.17 ).
English manual
Read the complete manual section
Read the source definition
8.21. Pseudo-Types
The PostgreSQL type system contains a number of special-purpose entries that are collectively called pseudo-types. A pseudo-type cannot be used as a column data type, but it can be used to declare a function's argument or result type. Each of the available pseudo-types is useful in situations where a function's behavior does not correspond to simply taking or returning a value of a specific SQL data type. Table 8.27 lists the existing pseudo-types.
Table 8.27. Pseudo-Types
| Name | Description |
|---|---|
any |
Indicates that a function accepts any input data type. |
anyelement |
Indicates that a function accepts any data type (see Section 36.2.5). |
anyarray |
Indicates that a function accepts any array data type (see Section 36.2.5). |
anynonarray |
Indicates that a function accepts any non-array data type (see Section 36.2.5). |
anyenum |
Indicates that a function accepts any enum data type (see Section 36.2.5 and Section 8.7). |
anyrange |
Indicates that a function accepts any range data type (see Section 36.2.5 and Section 8.17). |
anymultirange |
Indicates that a function accepts any multirange data type (see Section 36.2.5 and Section 8.17). |
anycompatible |
Indicates that a function accepts any data type, with automatic promotion of multiple arguments to a common data type (see Section 36.2.5). |
anycompatiblearray |
Indicates that a function accepts any array data type, with automatic promotion of multiple arguments to a common data type (see Section 36.2.5). |
anycompatiblenonarray |
Indicates that a function accepts any non-array data type, with automatic promotion of multiple arguments to a common data type (see Section 36.2.5). |
anycompatiblerange |
Indicates that a function accepts any range data type, with automatic promotion of multiple arguments to a common data type (see Section 36.2.5 and Section 8.17). |
anycompatiblemultirange |
Indicates that a function accepts any multirange data type, with automatic promotion of multiple arguments to a common data type (see Section 36.2.5 and Section 8.17). |
cstring |
Indicates that a function accepts or returns a null-terminated C string. |
internal |
Indicates that a function accepts or returns a server-internal data type. |
language_handler |
A procedural language call handler is declared to return language_handler. |
fdw_handler |
A foreign-data wrapper handler is declared to return fdw_handler. |
table_am_handler |
A table access method handler is declared to return table_am_handler. |
index_am_handler |
An index access method handler is declared to return index_am_handler. |
tsm_handler |
A tablesample method handler is declared to return tsm_handler. |
record |
Identifies a function taking or returning an unspecified row type. |
trigger |
A trigger function is declared to return trigger. |
event_trigger |
An event trigger function is declared to return event_trigger. |
pg_ddl_command |
Identifies a representation of DDL commands that is available to event triggers. |
void |
Indicates that a function returns no value. |
unknown |
Identifies a not-yet-resolved type, e.g., of an undecorated string literal. |
Functions coded in C (whether built-in or dynamically loaded) can be declared to accept or return any of these pseudo-types. It is up to the function author to ensure that the function will behave safely when a pseudo-type is used as an argument type.
Functions coded in procedural languages can use pseudo-types only as allowed by their implementation languages. At present most procedural languages forbid use of a pseudo-type as an argument type, and allow only void and record as a result type (plus trigger or event_trigger when the function is used as a trigger or event trigger). Some also support polymorphic functions using the polymorphic pseudo-types, which are shown above and discussed in detail in Section 36.2.5.
The internal pseudo-type is used to declare functions that are meant only to be called internally by the database system, and not by direct invocation in an SQL query. If a function has at least one internal-type argument then it cannot be called from SQL. To preserve the type safety of this restriction it is important to follow this coding rule: do not create any function that is declared to return internal unless it has at least one internal argument.
Catalog attributes
Source bootstrap values for this build. See pg_type for field meanings. Header defaults are included; build-dependent constants remain symbolic. This is not a live-server measurement.
oid4537descrpseudo-type representing a polymorphic base type that is a multirangetypacl_null_typlen-1typelem0typnameanymultirangetypsend-typtypeptypaligndtyparray0typbyvalftypdelim','typinputanymultirange_intypmodin-typndims0typownerPOSTGREStyprelid0typmodout-typoutputanymultirange_outtyptypmod-1typanalyze-typdefault_null_typnotnullftypreceive-typstoragextypbasetype0typcategoryPtypcollation0typisdefinedttypnamespacepg_catalogtypsubscript-typdefaultbin_null_array_type_oid0typispreferredfarray_type_name
Operator overloads 35
Each operand signature is a separate overload. Catalog implementation functions and result types belong to the same source build.
| Operator | Left operand | Right operand | Result | Meaning | Implementation |
|---|---|---|---|---|---|
= | anymultirange | anymultirange | bool | equal | multirange_eq |
<> | anymultirange | anymultirange | bool | not equal | multirange_ne |
< | anymultirange | anymultirange | bool | less than | multirange_lt |
<= | anymultirange | anymultirange | bool | less than or equal | multirange_le |
>= | anymultirange | anymultirange | bool | greater than or equal | multirange_ge |
> | anymultirange | anymultirange | bool | greater than | multirange_gt |
&& | anyrange | anymultirange | bool | overlaps | range_overlaps_multirange |
&& | anymultirange | anyrange | bool | overlaps | multirange_overlaps_range |
&& | anymultirange | anymultirange | bool | overlaps | multirange_overlaps_multirange |
@> | anymultirange | anyelement | bool | contains | multirange_contains_elem |
@> | anymultirange | anyrange | bool | contains | multirange_contains_range |
@> | anymultirange | anymultirange | bool | contains | multirange_contains_multirange |
<@ | anyelement | anymultirange | bool | is contained by | elem_contained_by_multirange |
<@ | anyrange | anymultirange | bool | is contained by | range_contained_by_multirange |
<@ | anymultirange | anymultirange | bool | is contained by | multirange_contained_by_multirange |
@> | anyrange | anymultirange | bool | contains | range_contains_multirange |
<@ | anymultirange | anyrange | bool | is contained by | multirange_contained_by_range |
&< | anyrange | anymultirange | bool | overlaps or is left of | range_overleft_multirange |
&< | anymultirange | anyrange | bool | overlaps or is left of | multirange_overleft_range |
&< | anymultirange | anymultirange | bool | overlaps or is left of | multirange_overleft_multirange |
&> | anyrange | anymultirange | bool | overlaps or is right of | range_overright_multirange |
&> | anymultirange | anyrange | bool | overlaps or is right of | multirange_overright_range |
&> | anymultirange | anymultirange | bool | overlaps or is right of | multirange_overright_multirange |
-|- | anyrange | anymultirange | bool | is adjacent to | range_adjacent_multirange |
-|- | anymultirange | anyrange | bool | is adjacent to | multirange_adjacent_range |
-|- | anymultirange | anymultirange | bool | is adjacent to | multirange_adjacent_multirange |
+ | anymultirange | anymultirange | anymultirange | multirange union | multirange_union |
- | anymultirange | anymultirange | anymultirange | multirange minus | multirange_minus |
* | anymultirange | anymultirange | anymultirange | multirange intersect | multirange_intersect |
<< | anyrange | anymultirange | bool | is left of | range_before_multirange |
<< | anymultirange | anyrange | bool | is left of | multirange_before_range |
<< | anymultirange | anymultirange | bool | is left of | multirange_before_multirange |
>> | anyrange | anymultirange | bool | is right of | range_after_multirange |
>> | anymultirange | anyrange | bool | is right of | multirange_after_range |
>> | anymultirange | anymultirange | bool | is right of | multirange_after_multirange |
Operator classes 3
Operator classes whose declared input type matches this type. Polymorphic classes, casts and expression indexes can provide additional index paths; this list is not an exhaustive yes/no index-support test.
| Class | Index method | Input type | Family | Default | Storage type |
|---|---|---|---|---|---|
multirange_ops | btree | anymultirange | btree/multirange_ops | Yes | Same as input |
multirange_ops | hash | anymultirange | hash/multirange_ops | Yes | Same as input |
multirange_ops | gist | anymultirange | gist/multirange_ops | Yes | anyrange |
Version comparison
PostgreSQL 17.11 → 18.6. Source build identifiers and prose are excluded from attribute changes.
No catalog or structured attribute changes between these samples.
The documentation also differs between these builds; inspect the versioned manual definitions.
Documentation and source
- Build
- 18.6 · https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2
- Fingerprint
555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f
Related entries
All Data Types · Download this version as JSON · The first recorded sample does not establish when a type was introduced.