Operators

In the object hierarchy of every database you will find Operators. Operators can be added by selecting CREATE OPERATOR from the Operators context menu. Once an operator has been created, it can be commented on and dropped. This section describes how to create, comment on, and drop an operator with RHDB Administrator.

For more information on operators, refer to Operators under the Extending SQL chapter of the Red Hat Database Administrator and User's Guide.

Creating an Operator

When creating an operator, you must set the following parameters:

The remainder of the CREATE OPERATOR parameters are optional. For information on these parameters, see CREATE OPERATOR in the Red Hat Database SQL Guide and Reference.

This example describes how to define a new operator called @$.

  1. Click on the + beside the database name to see the contents of the database, then do the same to expand Operators.

  2. Right-click on Operators and select CREATE OPERATOR. The CREATE OPERATOR dialog appears.

    Using this dialog you will create an operator named @$, which will be a left unary operator that does exactly what the function get_amount_by_customer does. If you have dropped that function, please re-create it now.

  3. The first field is for the name of the operator. Type: @$

  4. From the Procedure drop-down list, select: get_amount_by_customer(int4)

  5. As the Left Hand Argument, select: int4

    As this is a left unary operator, you do not need to enter anything for the Right Hand Argument. (Had this been a binary operator, a Right Hand Argument would have been required.) You may also leave all of the optional parameters for this operator blank.

  6. Click OK to define the new operator.

Note that the operator @$(LEFT = int4)->numeric has been added under the Operators node in the Tree View.

RHDB Administrator also enables you to perform the following operations on existing operators: