Greetings,
* Robert Haas (robertmhaas@gmail.com) wrote:
> Hmm, this all seems like a pretty big semantic change. IIUC, right
> now, a SQL function can only contain one statement, but it seems like
> with this patch you can have a block in there with a bunch of
> statements, sorta like plpgsql.
From our docs:
CREATE FUNCTION tf1 (accountno integer, debit numeric) RETURNS numeric AS $$
UPDATE bank
SET balance = balance - debit
WHERE accountno = tf1.accountno;
SELECT 1;
$$ LANGUAGE SQL;
https://www.postgresql.org/docs/current/xfunc-sql.html
Haven't looked at the patch, tho if it adds support for something the
SQL standard defines, that generally seems like a positive to me.
Thanks,
Stephen