Contents
to_regoperator()
A function converting an operator name to its OID
to_regoperator()
is a system function translating an operator name (with parameter types) to its OID.
to_regoperator()
was added in PostgreSQL 9.4.
Usage
to_regoperator (text
) →regoperator
NULL
is returned if the specified combination of operator and parameter types is not found or does not exist.
Change history
- PostgreSQL 16
- PostgreSQL 9.4
- added (commit dfc0219f)
Examples
Basic usage example for to_regoperator()
:
postgres=# SELECT to_regoperator('*(bigint,bigint)')::oid; to_regoperator ---------------- 686 (1 row)
NULL is returned if the specified operator is not found or does not exist:
postgres=# SELECT to_regoperator('*(text,text)')::oid IS NULL; ?column? ---------- t (1 row)
References
- PostgreSQL documentation: System Catalog Information Functions