Contents
to_regoper()
A function converting an operator name to its OID
to_regoper()
is a system function translating an operator name to its OID.
to_regoper()
was added in PostgreSQL 9.4.
Usage
to_regoper (text
) →regoper
NULL
is returned if the specified operator is not found or does not exist, or if the operator has mulitple signatures.
Note that as the number of operators with only one signature is extremely small, this function is of little practical use. Use to_regoperator()
instead.
Change history
- PostgreSQL 16
- PostgreSQL 9.4
- added (commit 0886fc6a)
Examples
Basic usage example for to_regoper()
:
postgres=# SELECT to_regoper('@?')::oid; to_regoper ------------ 4012 (1 row)
Most operators have more than one signature, so NULL
will be returned:
postgres=# SELECT to_regoper('+')::oid IS NULL; ?column? ---------- t (1 row)
References
- PostgreSQL documentation: System Catalog Information Functions