Re: SQL-standard function body
Peter Eisentraut <peter.eisentraut@enterprisedb.com>
From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Tom Lane <tgl@sss.pgh.pa.us>, Julien Rouhaud <rjuju123@gmail.com>
Cc: Noah Misch <noah@leadboat.com>,
Jaime Casanova <jcasanov@systemguards.com.ec>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-06-07T19:49:59Z
Lists: pgsql-hackers
On 07.06.21 17:27, Tom Lane wrote: > ... I tend to agree with Julien's position here. It seems really ugly > to prohibit empty statements just for implementation convenience. > However, the way I'd handle it is to have the grammar remove them, > which is what it does in other contexts. I don't think there's any > need to preserve them in ruleutils output --- there's a lot of other > normalization we do on the way to that, and this seems to fit in. Ok, if that's what people prefer. > BTW, is it just me, or does SQL:2021 fail to permit multiple > statements in a procedure at all? After much searching, I found the > BEGIN ATOMIC ... END syntax, but it's in <triggered SQL statement>, > in other words the body of a trigger not a procedure. I cannot find > any production that connects a <routine body> to that. There's an > example showing use of BEGIN ATOMIC as a procedure statement, so > they clearly*meant* to allow it, but it looks like somebody messed > up the grammar. It's in the SQL/PSM part.
Commits
-
Don't crash on empty statements in SQL-standard function bodies.
- bfeede9fa464 14.0 landed
-
psql: Fix line continuation prompts for unbalanced parentheses
- d9a9f4b4b92a 14.0 landed
-
Provide query source text when parsing a SQL-standard function body.
- 409723365b27 14.0 landed
-
Revert "Cope with NULL query string in ExecInitParallelPlan()."
- 83efce7a1ebc 14.0 landed
-
Undo decision to allow pg_proc.prosrc to be NULL.
- 1111b2668d89 14.0 landed
-
SQL-standard function body
- e717a9a18b2e 14.0 landed
-
Move pg_stat_statements query jumbling to core.
- 5fd9dfa5f50e 14.0 cited
-
Extend SQL function tests lightly
- 11b80d900fe4 14.0 landed