pg_operator

A system catalogue table storing information about operators

pg_operator is a system catalogue table storing information about operators.

psql commands

  • \do lists all user-defined operators
  • \doS lists built-in operators

Definition by PostgreSQL version

pg_operator (PostgreSQL 13)

             Table "pg_catalog.pg_operator"
    Column    |  Type   | Collation | Nullable | Default
--------------+---------+-----------+----------+---------
 oid          | oid     |           | not null |
 oprname      | name    |           | not null |
 oprnamespace | oid     |           | not null |
 oprowner     | oid     |           | not null |
 oprkind      | "char"  |           | not null |
 oprcanmerge  | boolean |           | not null |
 oprcanhash   | boolean |           | not null |
 oprleft      | oid     |           | not null |
 oprright     | oid     |           | not null |
 oprresult    | oid     |           | not null |
 oprcom       | oid     |           | not null |
 oprnegate    | oid     |           | not null |
 oprcode      | regproc |           | not null |
 oprrest      | regproc |           | not null |
 oprjoin      | regproc |           | not null |
Indexes:
    "pg_operator_oid_index" UNIQUE, btree (oid)
    "pg_operator_oprname_l_r_n_index" UNIQUE, btree (oprname, oprleft, oprright, oprnamespace)
    

Documentation: pg_operator

pg_operator (PostgreSQL 12)

             Table "pg_catalog.pg_operator"
    Column    |  Type   | Collation | Nullable | Default
--------------+---------+-----------+----------+---------
 oid          | oid     |           | not null |
 oprname      | name    |           | not null |
 oprnamespace | oid     |           | not null |
 oprowner     | oid     |           | not null |
 oprkind      | "char"  |           | not null |
 oprcanmerge  | boolean |           | not null |
 oprcanhash   | boolean |           | not null |
 oprleft      | oid     |           | not null |
 oprright     | oid     |           | not null |
 oprresult    | oid     |           | not null |
 oprcom       | oid     |           | not null |
 oprnegate    | oid     |           | not null |
 oprcode      | regproc |           | not null |
 oprrest      | regproc |           | not null |
 oprjoin      | regproc |           | not null |
Indexes:
    "pg_operator_oid_index" UNIQUE, btree (oid)
    "pg_operator_oprname_l_r_n_index" UNIQUE, btree (oprname, oprleft, oprright, oprnamespace)
    

Documentation: pg_operator

pg_operator (PostgreSQL 11)

             Table "pg_catalog.pg_operator"
    Column    |  Type   | Collation | Nullable | Default
--------------+---------+-----------+----------+---------
 oprname      | name    |           | not null |
 oprnamespace | oid     |           | not null |
 oprowner     | oid     |           | not null |
 oprkind      | "char"  |           | not null |
 oprcanmerge  | boolean |           | not null |
 oprcanhash   | boolean |           | not null |
 oprleft      | oid     |           | not null |
 oprright     | oid     |           | not null |
 oprresult    | oid     |           | not null |
 oprcom       | oid     |           | not null |
 oprnegate    | oid     |           | not null |
 oprcode      | regproc |           | not null |
 oprrest      | regproc |           | not null |
 oprjoin      | regproc |           | not null |
Indexes:
    "pg_operator_oid_index" UNIQUE, btree (oid)
    "pg_operator_oprname_l_r_n_index" UNIQUE, btree (oprname, oprleft, oprright, oprnamespace)
    

Documentation: pg_operator

pg_operator (PostgreSQL 10)

             Table "pg_catalog.pg_operator"
    Column    |  Type   | Collation | Nullable | Default
--------------+---------+-----------+----------+---------
 oprname      | name    |           | not null |
 oprnamespace | oid     |           | not null |
 oprowner     | oid     |           | not null |
 oprkind      | "char"  |           | not null |
 oprcanmerge  | boolean |           | not null |
 oprcanhash   | boolean |           | not null |
 oprleft      | oid     |           | not null |
 oprright     | oid     |           | not null |
 oprresult    | oid     |           | not null |
 oprcom       | oid     |           | not null |
 oprnegate    | oid     |           | not null |
 oprcode      | regproc |           | not null |
 oprrest      | regproc |           | not null |
 oprjoin      | regproc |           | not null |
Indexes:
    "pg_operator_oid_index" UNIQUE, btree (oid)
    "pg_operator_oprname_l_r_n_index" UNIQUE, btree (oprname, oprleft, oprright, oprnamespace)
    

Documentation: pg_operator

pg_operator (PostgreSQL 9.6)

   Table "pg_catalog.pg_operator"
    Column    |  Type   | Modifiers
--------------+---------+-----------
 oprname      | name    | not null
 oprnamespace | oid     | not null
 oprowner     | oid     | not null
 oprkind      | "char"  | not null
 oprcanmerge  | boolean | not null
 oprcanhash   | boolean | not null
 oprleft      | oid     | not null
 oprright     | oid     | not null
 oprresult    | oid     | not null
 oprcom       | oid     | not null
 oprnegate    | oid     | not null
 oprcode      | regproc | not null
 oprrest      | regproc | not null
 oprjoin      | regproc | not null
Indexes:
    "pg_operator_oid_index" UNIQUE, btree (oid)
    "pg_operator_oprname_l_r_n_index" UNIQUE, btree (oprname, oprleft, oprright, oprnamespace)
    

Documentation: pg_operator

pg_operator (PostgreSQL 9.5)

   Table "pg_catalog.pg_operator"
    Column    |  Type   | Modifiers
--------------+---------+-----------
 oprname      | name    | not null
 oprnamespace | oid     | not null
 oprowner     | oid     | not null
 oprkind      | "char"  | not null
 oprcanmerge  | boolean | not null
 oprcanhash   | boolean | not null
 oprleft      | oid     | not null
 oprright     | oid     | not null
 oprresult    | oid     | not null
 oprcom       | oid     | not null
 oprnegate    | oid     | not null
 oprcode      | regproc | not null
 oprrest      | regproc | not null
 oprjoin      | regproc | not null
Indexes:
    "pg_operator_oid_index" UNIQUE, btree (oid)
    "pg_operator_oprname_l_r_n_index" UNIQUE, btree (oprname, oprleft, oprright, oprnamespace)
    

Documentation: pg_operator

pg_operator (PostgreSQL 9.4)

   Table "pg_catalog.pg_operator"
    Column    |  Type   | Modifiers
--------------+---------+-----------
 oprname      | name    | not null
 oprnamespace | oid     | not null
 oprowner     | oid     | not null
 oprkind      | "char"  | not null
 oprcanmerge  | boolean | not null
 oprcanhash   | boolean | not null
 oprleft      | oid     | not null
 oprright     | oid     | not null
 oprresult    | oid     | not null
 oprcom       | oid     | not null
 oprnegate    | oid     | not null
 oprcode      | regproc | not null
 oprrest      | regproc | not null
 oprjoin      | regproc | not null
Indexes:
    "pg_operator_oid_index" UNIQUE, btree (oid)
    "pg_operator_oprname_l_r_n_index" UNIQUE, btree (oprname, oprleft, oprright, oprnamespace)
    

Documentation: pg_operator

pg_operator (PostgreSQL 9.3)

   Table "pg_catalog.pg_operator"
    Column    |  Type   | Modifiers
--------------+---------+-----------
 oprname      | name    | not null
 oprnamespace | oid     | not null
 oprowner     | oid     | not null
 oprkind      | "char"  | not null
 oprcanmerge  | boolean | not null
 oprcanhash   | boolean | not null
 oprleft      | oid     | not null
 oprright     | oid     | not null
 oprresult    | oid     | not null
 oprcom       | oid     | not null
 oprnegate    | oid     | not null
 oprcode      | regproc | not null
 oprrest      | regproc | not null
 oprjoin      | regproc | not null
Indexes:
    "pg_operator_oid_index" UNIQUE, btree (oid)
    "pg_operator_oprname_l_r_n_index" UNIQUE, btree (oprname, oprleft, oprright, oprnamespace)
    

Documentation: pg_operator

pg_operator (PostgreSQL 9.2)

   Table "pg_catalog.pg_operator"
    Column    |  Type   | Modifiers
--------------+---------+-----------
 oprname      | name    | not null
 oprnamespace | oid     | not null
 oprowner     | oid     | not null
 oprkind      | "char"  | not null
 oprcanmerge  | boolean | not null
 oprcanhash   | boolean | not null
 oprleft      | oid     | not null
 oprright     | oid     | not null
 oprresult    | oid     | not null
 oprcom       | oid     | not null
 oprnegate    | oid     | not null
 oprcode      | regproc | not null
 oprrest      | regproc | not null
 oprjoin      | regproc | not null
Indexes:
    "pg_operator_oid_index" UNIQUE, btree (oid)
    "pg_operator_oprname_l_r_n_index" UNIQUE, btree (oprname, oprleft, oprright, oprnamespace)
    

Documentation: pg_operator

pg_operator (PostgreSQL 9.1)

   Table "pg_catalog.pg_operator"
    Column    |  Type   | Modifiers
--------------+---------+-----------
 oprname      | name    | not null
 oprnamespace | oid     | not null
 oprowner     | oid     | not null
 oprkind      | "char"  | not null
 oprcanmerge  | boolean | not null
 oprcanhash   | boolean | not null
 oprleft      | oid     | not null
 oprright     | oid     | not null
 oprresult    | oid     | not null
 oprcom       | oid     | not null
 oprnegate    | oid     | not null
 oprcode      | regproc | not null
 oprrest      | regproc | not null
 oprjoin      | regproc | not null
Indexes:
    "pg_operator_oid_index" UNIQUE, btree (oid)
    "pg_operator_oprname_l_r_n_index" UNIQUE, btree (oprname, oprleft, oprright, oprnamespace)
    

Documentation: pg_operator

pg_operator (PostgreSQL 9.0)

   Table "pg_catalog.pg_operator"
    Column    |  Type   | Modifiers
--------------+---------+-----------
 oprname      | name    | not null
 oprnamespace | oid     | not null
 oprowner     | oid     | not null
 oprkind      | "char"  | not null
 oprcanmerge  | boolean | not null
 oprcanhash   | boolean | not null
 oprleft      | oid     | not null
 oprright     | oid     | not null
 oprresult    | oid     | not null
 oprcom       | oid     | not null
 oprnegate    | oid     | not null
 oprcode      | regproc | not null
 oprrest      | regproc | not null
 oprjoin      | regproc | not null
Indexes:
    "pg_operator_oid_index" UNIQUE, btree (oid)
    "pg_operator_oprname_l_r_n_index" UNIQUE, btree (oprname, oprleft, oprright, oprnamespace)
    

Documentation: pg_operator

pg_operator (PostgreSQL 8.4)

   Table "pg_catalog.pg_operator"
    Column    |  Type   | Modifiers
--------------+---------+-----------
 oprname      | name    | not null
 oprnamespace | oid     | not null
 oprowner     | oid     | not null
 oprkind      | "char"  | not null
 oprcanmerge  | boolean | not null
 oprcanhash   | boolean | not null
 oprleft      | oid     | not null
 oprright     | oid     | not null
 oprresult    | oid     | not null
 oprcom       | oid     | not null
 oprnegate    | oid     | not null
 oprcode      | regproc | not null
 oprrest      | regproc | not null
 oprjoin      | regproc | not null
Indexes:
    "pg_operator_oid_index" UNIQUE, btree (oid)
    "pg_operator_oprname_l_r_n_index" UNIQUE, btree (oprname, oprleft, oprright, oprnamespace)
    

Documentation: pg_operator

pg_operator (PostgreSQL 8.3)

   Table "pg_catalog.pg_operator"
    Column    |  Type   | Modifiers
--------------+---------+-----------
 oprname      | name    | not null
 oprnamespace | oid     | not null
 oprowner     | oid     | not null
 oprkind      | "char"  | not null
 oprcanmerge  | boolean | not null
 oprcanhash   | boolean | not null
 oprleft      | oid     | not null
 oprright     | oid     | not null
 oprresult    | oid     | not null
 oprcom       | oid     | not null
 oprnegate    | oid     | not null
 oprcode      | regproc | not null
 oprrest      | regproc | not null
 oprjoin      | regproc | not null
Indexes:
    "pg_operator_oid_index" UNIQUE, btree (oid)
    "pg_operator_oprname_l_r_n_index" UNIQUE, btree (oprname, oprleft, oprright, oprnamespace)
    

Documentation: pg_operator

pg_operator (PostgreSQL 8.2)

   Table "pg_catalog.pg_operator"
    Column    |  Type   | Modifiers
--------------+---------+-----------
 oprname      | name    | not null
 oprnamespace | oid     | not null
 oprowner     | oid     | not null
 oprkind      | "char"  | not null
 oprcanhash   | boolean | not null
 oprleft      | oid     | not null
 oprright     | oid     | not null
 oprresult    | oid     | not null
 oprcom       | oid     | not null
 oprnegate    | oid     | not null
 oprlsortop   | oid     | not null
 oprrsortop   | oid     | not null
 oprltcmpop   | oid     | not null
 oprgtcmpop   | oid     | not null
 oprcode      | regproc | not null
 oprrest      | regproc | not null
 oprjoin      | regproc | not null
Indexes:
    "pg_operator_oid_index" UNIQUE, btree (oid)
    "pg_operator_oprname_l_r_n_index" UNIQUE, btree (oprname, oprleft, oprright, oprnamespace)
    

Documentation: pg_operator

Change history

Note: any changes prior to PostgreSQL 7.3 are not reflected in this list.

Examples

postgres=# SELECT * FROM pg_operator WHERE oprname = '!';
 oid | oprname | oprnamespace | oprowner | oprkind | oprcanmerge | oprcanhash | oprleft | oprright | oprresult | oprcom | oprnegate |   oprcode   | oprrest | oprjoin 
-----+---------+--------------+----------+---------+-------------+------------+---------+----------+-----------+--------+-----------+-------------+---------+---------
 388 | !       |           11 |       10 | r       | f           | f          |      20 |        0 |      1700 |      0 |         0 | numeric_fac | -       | -
(1 row)

postgres=# \do !
                               List of operators
   Schema   | Name | Left arg type | Right arg type | Result type | Description 
------------+------+---------------+----------------+-------------+-------------
 pg_catalog | !    | bigint        |                | numeric     | factorial
(1 row)

Categories

Data type, DDL, System catalogue