CALL

|         CALL         |                       |            |                  |                            |
|:--------------------:|-----------------------|------------|------------------|----------------------------|
|[Prev](sql-begin.html)|[Up](sql-commands.html)|SQL Commands|[Home](index.html)| [Next](sql-checkpoint.html)|

---

[]()

## CALL

CALL — invoke a procedure

## Synopsis

```
CALL name ( [ argument ] [, ...] )

```

## Description

`CALL` executes a procedure.

 If the procedure has any output parameters, then a result row will be returned, containing the values of those parameters.

## 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](sql-syntax-calling-funcs.html) for details.

 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.)

## Notes

 The user must have `EXECUTE` privilege on the procedure in order to be allowed to invoke it.

 To call a function (not a procedure), use `SELECT` instead.

 If `CALL` is executed in a transaction block, then the called procedure cannot execute transaction control statements. Transaction control statements are only allowed if `CALL` is executed in its own transaction.

PL/pgSQL handles output parameters in `CALL` commands differently; see [Section 43.6.3](plpgsql-control-structures.html#PLPGSQL-STATEMENTS-CALLING-PROCEDURE).

## Examples

```
CALL do_db_maintenance();

```

## Compatibility

`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.

## See Also

[CREATE PROCEDURE](sql-createprocedure.html)

---

|[Prev](sql-begin.html)|[Up](sql-commands.html)| [Next](sql-checkpoint.html)|
|:---------------------|:---------------------:|---------------------------:|
|        BEGIN         |  [Home](index.html)   |         CHECKPOINT         |

 // \<![CDATA[ \<-- For SVG support if ('WebSocket' in window) { (function() { function refreshCSS() { var sheets = [].slice.call(document.getElementsByTagName("link")); var head = document.getElementsByTagName("head")[0]; for (var i = 0; i \< sheets.length; ++i) { var elem = sheets[i]; head.removeChild(elem); var rel = elem.rel; if (elem.href && typeof rel != "string" || rel.length == 0 || rel.toLowerCase() == "stylesheet") { var url = elem.href.replace(/(&|\\?)\_cacheOverride=\\d+/, ''); elem.href = url + (url.indexOf('?') \>= 0 ? '&' : '?') + '\_cacheOverride=' + (new Date().valueOf()); } head.appendChild(elem); } } var protocol = window.location.protocol === 'http:' ? 'ws://' : 'wss://'; var address = protocol + window.location.host + window.location.pathname + '/ws'; var socket = new WebSocket(address); socket.onmessage = function(msg) { if (msg.data == 'reload') window.location.reload(); else if (msg.data == 'refreshcss') refreshCSS(); }; console.log('Live reload enabled.'); })(); } // ]]\>