Commands
delete
update
insert
select
SELECT vs PERFORM vs CALL
A snag with writing procedures rather than functions is CALL procedurename(args)
can’t be combined with FROM... WHERE
clauses. A way around this in PL/PGSQL is to use PERFORM functioname(args)
which acts like a procedure in that its result is ignored, so doesn’t require a dummy variable while opening the way for it to also be used as a normal query invoked by SELECT
.
There are many tokens to tweak queries returning sets or aggregators.