CALL - invoke a procedure
| Use Case | Command | Description |
|---|---|---|
| Simple procedure call | CALL do_db_maintenance(); |
Invoke a procedure with no arguments |
| Call with positional arguments | CALL my_proc(42, 'text'); |
Pass arguments in order |
| Call with named arguments | CALL my_proc(param1 => 'value'); |
Explicitly name parameters for clarity |
| Handle output parameters | CALL proc_with_out(NULL); |
Pass NULL for OUT parameters (value not evaluated) |
| Check privileges | — | User must have EXECUTE privilege on the procedure |
CALL name ( [ argument ] [, ...] )
CALL executes a procedure.
If the procedure has any output parameters, then a result row will be returned, containing the values of those parameters.
name — The name (optionally schema-qualified) of the procedure.argument — An argument expression for the procedure call. Arguments can include parameter names, using the syntax name => value. This works the same as in ordinary function calls (see Section 4.3). Arguments must be supplied for all procedure parameters that lack defaults, including OUT parameters. However, arguments matching OUT parameters are not evaluated, so it's customary to just write NULL for them. (Writing something else for an OUT parameter might cause compatibility problems with future PostgreSQL versions.)EXECUTE privilege on the procedure in order to be allowed to invoke it.SELECT instead.CALL do_db_maintenance();
CALL conforms to the SQL standard, except for the handling of output parameters. The standard says that users should write variables to receive the values of output parameters.
Generated by phpman v4.9.26-5-g7740029 Author: Che Dong Under GNU General Public License
2026-08-14 21:23 @2600:1f28:365:80b0:4d23:66fa:c2bb:7bae
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)