Function Editor
Top  Previous  Next


The Function Editor allows you to create new functions and to edit the existing ones (see How to create a function and How to edit a function).

Function  
 
The main function parameters are set on the Function tab.

Name
Set the name of the new function.

Returns
Select the type of the returned value from the drop-down list an check the Set of option if the function returns set of results.

Language
This drop-down list allows you to select the function language from the list of database languages.

Arguments
Set the function arguments by right-clicking in the list and selecting Add Argument or Insert Argument. After the argument is added select its type from the Argument Type drop-down list. To delete the existing argument, select Delete Argument from the popup menu.

Execute with definer's privileges
This option idicates that the function will be executed with the definer's privileges set.

Replace multiple calls with single on same arguments
The switch in position Always (IMMUTABLE) indicates that the multiple function calls with same arguments will be replaced by a single call. The Within Transaction (STABLE) position means that the function has a stable value with same parameters within current transaction. The Never (VOLATILE) position indicates that the multiple calls will not be replaced by a single call.

Returns null on null input
This option indicates that the function always returns NULL whenever any of its arguments are NULL. If this attribute is specified, the function is not executed when there are NULL arguments; instead a NULL result is assumed automatically. When Returns null on null input is not checked, the function will be called for NULL inputs. It is then the function author's responsibility to check for NULLs if necessary and respond appropriately.

Definition
Set the function definition in the edit area.

Description  
 
The Description tab contains the function description. Button Save Description saves the edited description.

DDL  
 
On the DDL tab you can view the SQL text for creating the function with the properties you set. This text can't be edited, but can be copied to the clipboard.

To call the PostgreSQL Reference, click button Help on SQL on the toolbar.

Button Default Size brings the window to the default size (restricted by the main window and the DB Explorer).

The drop-down list of the current database functions on the toolbar allows you to switch the edited function.

When you are done, click button Compile on the toolbar to start the process of compilation. The Compile Window will appear where you will be able to view and edit the result SQL statement for creating the new function. Commit the transaction, and if it is successful, the new function will be created or the function parameters will be changed.

See also:
Table Editor
Schema Editor
View Editor
Rule Editor
Trigger Editor
Index Editor
Sequence Editor
Type Editor
Aggregate Editor
Operator Editor
Language Editor
Compile Window


Availability:
Windows Professional

Yes

Windows Lite

Yes

Linux Professional

Yes

Linux Lite

Yes