CALL(7)

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

πŸ’… CALL(7) β€” bestie, it's the CALL page

okay so real talk, the docs call this one CALL(7), and it's part of the PostgreSQL 16.15 documentation set. it's short, it's sweet, it's giving "one job and I do it well." let's get into it 🫢


✨ NAME ✨

CALL β€” invoke a procedure. that's it. that's the whole vibe. πŸ”₯

✨ SYNOPSIS ✨

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

✨ DESCRIPTION ✨

CALL executes a procedure. literally its entire personality. πŸ‘‘

and here's the cute part: if the procedure has any output parameters, then a result row will be returned, containing the values of those parameters. so you get something back. a lil treat. πŸŽ€

🌸 PARAMETERS 🌸

  • name β€” the name of the procedure, optionally schema-qualified. so like, you can be specific about which schema you mean. iykyk.
  • 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.) β€” so bestie, no defaults = you gotta supply it. and for the OUT ones, just write NULL and move on. writing something spicy there could bite you with future PostgreSQL versions. πŸ’€

πŸ’œ NOTES πŸ’œ

  • The user must have EXECUTE privilege on the procedure in order to be allowed to invoke it. no privilege, no call. security said what it said. πŸ”’
  • To call a function (not a procedure), use SELECT instead. different tool, different job, don't mix them up fr fr.
  • 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. so if you're inside a transaction block, no transaction control statements from inside the procedure β€” that privilege only shows up when CALL runs in its own transaction. respect the rules. 🧚
  • PL/pgSQL handles output parameters in CALL commands differently; see Section 43.6.3. yes, differently. go read that section, i'm not spoiling it. πŸ™ˆ

⭐ EXAMPLES ⭐

CALL do_db_maintenance();

iconic. clean. no notes. ✨

🌈 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. so like, standard says do it this way, postgres says "we do it our way, closer to the vibes." not us being messy, it's just ✨the handling of output parameters✨. 😭

πŸ‘‘ SEE ALSO πŸ‘‘

  • CREATE PROCEDURE (CREATE_PROCEDURE(7)) β€” you gotta make the procedure before you can call it, bestie. that's the pipeline. πŸ’…

and that's the whole page!! quick sign-off because the docs insist: this was PostgreSQL 16.15, dated 2026, and the page is CALL(7). slay, go call some procedures. πŸŒΈπŸ’–πŸŽ€

πŸ“¦ where this page comes from