PostgreSQL provides four kinds of functions:
- query language functions (functions written in SQL)
- procedural language functions (functions written in, for example, PL/Tcl or PL/pgSQL)
- internal functions
- C-language functions
Every kind of function can take base types, composite types, or combinations of these as arguments (parameters). In addition, every kind of function can return a base type or a composite type. Many kinds of functions can take or return certain pseudo-types (such as polymorphic types), but the available facilities vary.
Just simply click to open an object pane for Function.
A right-click displays the popup menu or using the object pane
toolbar below, allowing you to create new, edit and delete the selected function.
Create Function
To create a new function
- Select anywhere on the object pane.
- Click the
New Function from the object pane toolbar.
or - Right-click and select
New Function from the popup menu.
- Edit function properties on the appropriate tabs of the Function Designer.
Hint: To create new function
you can also right-click the Function node of the navigation pane
and select the New Function from the popup
menu.
To create a new function with modification as one of the existing function
- Select the function for modifying in the navigation pane/object pane.
- Right-click and select the
Design Function from the popup menu or simply double-click the function.
or - Click the
Design Function from the object pane toolbar.
- Modify function properties on the appropriate tabs of the Function Designer.
- Click
Save As.
To edit the existing function (manage its definition, advanced etc)
- Select the function for editing in the navigation pane/object pane.
- Right-click and select the
Design Function from the popup menu or simply double-click the function.
or - Click the
Design Function from the object pane toolbar.
- Edit function properties on the appropriate tabs of the Function Designer.
To change the name of the function
- Select the function for editing in the navigation pane/object pane.
- Right-click and select the Rename from the popup menu.
Run Function
To run a function in the navigation pane/object pane
- Select the function for executing in the navigation pane/object pane.
- Click the
Execute Function from the object pane toolbar.
or - Right-click and select
Execute Function from the popup menu.
- View/edit the returned data on the Result tab.
To run a function in the Function Designer
- Create a new function/open the existing function.
- Click
Run.
- View/edit the returned data on the Result tab.
Delete Function
To delete a function
- Select the function for deleting in the navigation pane/object pane.
- Right-click and select the
Delete Function from the popup menu.
or - Click the
Delete Function from the object pane toolbar.
- Confirm deleting in the dialog window.
Achieve Function Information
To achieve a function information (OID, language, volatility and DDL, etc)
- Select the function in the object pane.
- Right-click the selected function and choose Function Information from the popup menu to view the Object Information.
or - Choose View -> Object Information in the main menu.