Answers for "call vs perform"

0

call vs perform

CALL is an SQL command to execute a PROCEDURE and was added with Postgres 11, when SQL procedures were added. You cannot call a procedure with SELECT.

PERFORM is a PL/pgSQL command to execute any SELECT statement and discard the result by replacing the SELECT keyword (incl. plain FUNCTION calls). It has been part of PL/pgSQL since forever.

You cannot CALL a function, and you cannot PERFORM a procedure.
You can use PERFORM anywhere you could SELECT (without INTO) inside a PL/pgSQL code block.
Posted by: Guest on March-03-2022

Browse Popular Code Answers by Language