Skip to content

Latest commit

 

History

History
154 lines (98 loc) · 6.05 KB

operators.md

File metadata and controls

154 lines (98 loc) · 6.05 KB

Operator Operations

pgm.createOperator( operator_name, options )

Create a new operator - postgres docs

Arguments:

  • operator_name [Name] - name of the new operator
  • options [object] - options:
    • procedure [Name] - name of procedure performing operation
    • left [Name] - type of left argument
    • right [Name] - type of right argument
    • commutator [Name] - name of commutative operator
    • negator [Name] - name of negating operator
    • restrict [Name] - name of restriction procedure
    • join [Name] - name of join procedure
    • hashes [boolean] - adds HASHES clause
    • merges [boolean] - adds MERGES clause

Reverse Operation: dropOperator


pgm.dropOperator( operator_name, drop_options )

Drop a operator - postgres docs

Arguments:

  • operator_name [Name] - name of the operator to drop
  • drop_options [object] - options:
    • ifExists [boolean] - drops schema only if it exists
    • cascade [boolean] - drops also dependent objects
    • left [Name] - type of left argument
    • right [Name] - type of right argument

pgm.createOperatorClass( operator_class_name, type, index_method, operator_list, options )

Create a new operator class - postgres docs

Arguments:

  • operator_class_name [Name] - name of the new operator class
  • type [string] - data type of the new operator class
  • index_method [Name] - name of the index method of operator class
  • operator_list [array] - of operator objects
  • options [object] - options:
    • default [boolean] - adds DEFAULT clause
    • family [string] - type of left argument

Reverse Operation: dropOperatorClass


pgm.dropOperatorClass( operator_class_name, index_methoddrop_options )

Drop a operator class - postgres docs

Arguments:

  • operator_class_name [Name] - name of the operator class to drop
  • index_method [Name] - name of the index method of operator class
  • drop_options [object] - options:
    • ifExists [boolean] - drops schema only if it exists
    • cascade [boolean] - drops also dependent objects

pgm.renameOperatorClass( old_operator_class_name, index_method, new_operator_class_name )

Rename a operator class - postgres docs

Arguments:

  • old_operator_class_name [Name] - old name of the operator class
  • index_method [Name] - name of the index method of operator class
  • new_operator_class_name [Name] - new name of the operator class

pgm.createOperatorFamily( operator_family_name, index_method )

Create a new operator family - postgres docs

Arguments:

  • operator_family_name [Name] - name of the new operator family
  • index_method [Name] - name of the index method of operator family

Reverse Operation: dropOperatorFamily


pgm.dropOperatorFamily( operator_family_name, index_methoddrop_options )

Drop a operator family - postgres docs

Arguments:

  • operator_family_name [Name] - name of the operator family to drop
  • index_method [Name] - name of the index method of operator family
  • drop_options [object] - options:
    • ifExists [boolean] - drops schema only if it exists
    • cascade [boolean] - drops also dependent objects

pgm.renameOperatorFamily( old_operator_family_name, index_method, new_operator_family_name )

Rename a operator family - postgres docs

Arguments:

  • old_operator_family_name [Name] - old name of the operator family
  • index_method [Name] - name of the index method of operator family
  • new_operator_family_name [Name] - new name of the operator family

pgm.addToOperatorFamily( operator_family_name, index_method, operator_list )

Rename a operator family - postgres docs

Arguments:

  • operator_family_name [Name] - name of the operator family
  • index_method [Name] - name of the index method of operator family
  • operator_list [array] - of operator objects

pgm.removeFromOperatorFamily( operator_family_name, index_method, operator_list )

Rename a operator family - postgres docs

Arguments:

  • operator_family_name [Name] - name of the operator family
  • index_method [Name] - name of the index method of operator family
  • operator_list [array] - of operator objects

Operator List Definitions

Some functions for defining operators take as parameter operator_list which is array of objects with following structure:

  • type [string] - function or operator
  • number [number] - index
  • name [Name] - name of operator or procedure
  • params [array] - list of argument types of operator or procedure