]> begriffs open source - ai-pg/blob - full-docs/man7/CALL.7
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / man7 / CALL.7
1 '\" t
2 .\"     Title: CALL
3 .\"    Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\"      Date: 2025
6 .\"    Manual: PostgreSQL 18.0 Documentation
7 .\"    Source: PostgreSQL 18.0
8 .\"  Language: English
9 .\"
10 .TH "CALL" "7" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 CALL \- invoke a procedure
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 CALL \fIname\fR ( [ \fIargument\fR ] [, \&.\&.\&.] )
36 .fi
37 .SH "DESCRIPTION"
38 .PP
39 \fBCALL\fR
40 executes a procedure\&.
41 .PP
42 If the procedure has any output parameters, then a result row will be returned, containing the values of those parameters\&.
43 .SH "PARAMETERS"
44 .PP
45 \fIname\fR
46 .RS 4
47 The name (optionally schema\-qualified) of the procedure\&.
48 .RE
49 .PP
50 \fIargument\fR
51 .RS 4
52 An argument expression for the procedure call\&.
53 .sp
54 Arguments can include parameter names, using the syntax
55 \fIname\fR => \fIvalue\fR\&. This works the same as in ordinary function calls; see
56 Section\ \&4.3
57 for details\&.
58 .sp
59 Arguments must be supplied for all procedure parameters that lack defaults, including
60 OUT
61 parameters\&. However, arguments matching
62 OUT
63 parameters are not evaluated, so it\*(Aqs customary to just write
64 NULL
65 for them\&. (Writing something else for an
66 OUT
67 parameter might cause compatibility problems with future
68 PostgreSQL
69 versions\&.)
70 .RE
71 .SH "NOTES"
72 .PP
73 The user must have
74 EXECUTE
75 privilege on the procedure in order to be allowed to invoke it\&.
76 .PP
77 To call a function (not a procedure), use
78 \fBSELECT\fR
79 instead\&.
80 .PP
81 If
82 \fBCALL\fR
83 is executed in a transaction block, then the called procedure cannot execute transaction control statements\&. Transaction control statements are only allowed if
84 \fBCALL\fR
85 is executed in its own transaction\&.
86 .PP
87 PL/pgSQL
88 handles output parameters in
89 \fBCALL\fR
90 commands differently; see
91 Section\ \&41.6.3\&.
92 .SH "EXAMPLES"
93 .sp
94 .if n \{\
95 .RS 4
96 .\}
97 .nf
98 CALL do_db_maintenance();
99 .fi
100 .if n \{\
101 .RE
102 .\}
103 .SH "COMPATIBILITY"
104 .PP
105 \fBCALL\fR
106 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\&.
107 .SH "SEE ALSO"
108 CREATE PROCEDURE (\fBCREATE_PROCEDURE\fR(7))