3.26. Procedures
Procedures are almost like ordinary functions except for the fact that they can't return values as functions do. There are other essential differences; for instance, procedures can't be called as part of a DML command and must be called in isolation using the CALL command. The attributes of procedures are defined below:
12
| General | ||
|---|---|---|
| # | Field | Description |
| 1 | Language | The language in which the procedure is written. There are four built-in languages available when a new model is created in pgModeler: |
| 2 | Security | Indicates the security context in which the procedure is executed. Two values are accepted: |
1
| Parameters | ||
|---|---|---|
| # | Field | Description |
| 1 | Parameters | The parameters of the routine (name, type, mode, and default value). Use the buttons beside the list ( |
1234
| Transform types | |||
|---|---|---|---|
| # | Field | Group box | Description |
| 1 | Type | Data type | The data type. Besides the built-in types, the list also holds the user-defined types, domains and other types of the model. |
| 2 | Dimension | Data type | Number of dimensions when the type is an array ( |
| 3 | Format | Data type | Read-only preview of the data type as it is written in the SQL code, with length, precision, dimension and other modifiers applied. |
| 4 | Transform types | The transforms that a call to the routine should apply. Select the type in the group above and use the add button | |
1
| Definition | ||
|---|---|---|
| # | Field | Description |
| 1 | Source code | The complete set of commands that the procedure must execute. This field is language-dependent, which means that you cannot mix commands from different languages: only the language selected in the field |
1
| Configuration | ||
|---|---|---|
| # | Field | Description |
| 1 | Configuration parameters | Runtime configuration parameters of the routine ( |
The fields of the tab Definition vary according to the selected language. For the c language, the fields Symbol (the function name that defines the procedure in a shared library) and Library (the path to the shared object file on the destination server) are shown instead of the source code. For any other language, the source code field is shown; it is language-dependent, so commands of different languages can't be mixed.
References
Procedure DDL
https://www.postgresql.org/docs/current/static/sql-createprocedure.html
Procedure details
https://www.postgresql.org/docs/current/static/xproc.html