> For the complete documentation index, see [llms.txt](https://docs.postgresql.tw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.postgresql.tw/reference/sql-commands/sql-call.md).

# CALL

### 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](../../the-sql-language/sql-syntax/sql-syntax-calling-funcs.md) 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 41.6.3](/server-programming/plpgsql/plpgsql-control-structures.md#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](/reference/sql-commands/sql-createprocedure.md)

***

原文：[PostgreSQL 18.6 Documentation](https://www.postgresql.org/docs/18/sql-call.html)（英文原文，待翻譯）


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.postgresql.tw/reference/sql-commands/sql-call.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
