CALL(7)

πŸ“¦ version 14.24, in opensuse-leap 16.0

πŸ’… CALL(7): invoke a procedure πŸ’…

okay so bestie, this is the PostgreSQL 14.24 Documentation page for CALL(7) β€” the manual name is folded in near the top, we're not copying the header line, and we're literally about to make procedures make sense. no cap. 🫢

✨ NAME ✨

CALL β€” invoke a procedure. that's the whole name, and honestly it ate. πŸ’–

🌸 SYNOPSIS 🌸

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

πŸ¦‹ DESCRIPTION πŸ¦‹

CALL executes a procedure. lowkey that's its whole job, and it's iconic for it. ✨

If the procedure has any output parameters, then a result row will be returned, containing the values of those parameters. yes bestie, you get a row back with those values β€” slay. πŸŽ€

πŸ’œ 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 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. 🧚

πŸ“ EXAMPLES πŸ“

example time, and she is simple and she slays:

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. periodt. πŸ’…

⭐ SEE ALSO ⭐

xoxo, your PostgreSQL 14.24 docs bestie πŸ’– β€” dated 2026, page CALL(7), periodt. 🌈

πŸ“¦ where this page comes from