blob: 86a028f443823d78d96bf2d3770cf344eabf88de [file]
---
title: pg_operator
---
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
The `pg_operator` system catalog table stores information about operators, both built-in and those defined by `CREATE OPERATOR`. Unused column contain zeroes. For example, `oprleft` is zero for a prefix operator.
<a id="topic1__gy150092"></a>
<span class="tablecap">Table 1. pg\_catalog.pg\_operator</span>
| column | type | references | description |
|----------------|---------|-------------------|--------------------------------------------------------------------------------------------------------------------------|
| `oprname` | name |   | Name of the operator. |
| `oprnamespace` | oid | pg\_namespace.oid | The OID of the namespace that contains this operator. |
| `oprowner` | oid | pg\_authid.oid | Owner of the operator. |
| `oprkind` | char |   | `b` = infix (both), `l` = prefix (left), `r` = postfix (right) |
| `oprcanhash` | boolean |   | This operator supports hash joins. |
| `oprleft` | oid | pg\_type.oid | Type of the left operand. |
| `oprright` | oid | pg\_type.oid | Type of the right operand. |
| `oprresult` | oid | pg\_type.oid | Type of the result. |
| `oprcom` | oid | pg\_operator.oid | Commutator of this operator, if any. |
| `oprnegate` |   | pg\_operator.oid | Negator of this operator, if any. |
| `oprlsortop` | oid | pg\_operator.oid | If this operator supports merge joins, the operator that sorts the type of the left-hand operand (`L<L`). |
| `oprrsortop` | oid | pg\_operator.oid | If this operator supports merge joins, the operator that sorts the type of the right-hand operand (`R<R`). |
| `oprltcmpop` | oid | pg\_operator.oid | If this operator supports merge joins, the less-than operator that compares the left and right operand types (`L<R`). |
| `oprgtcmpop` | oid | pg\_operator.oid | If this operator supports merge joins, the greater-than operator that compares the left and right operand types (`L>R`). |
| `oprcode` | regproc | pg\_proc.oid | Function that implements this operator. |
| `oprrest ` | regproc | pg\_proc.oid | Restriction selectivity estimation function for this operator. |
| `oprjoin` | regproc | pg\_proc.oid | Join selectivity estimation function for this operator. |