Re: SQL-standard function body
Julien Rouhaud <rjuju123@gmail.com>
From: Julien Rouhaud <rjuju123@gmail.com>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Noah Misch <noah@leadboat.com>,
Jaime Casanova <jcasanov@systemguards.com.ec>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-06-07T09:10:50Z
Lists: pgsql-hackers
On Mon, Jun 7, 2021 at 4:52 PM Peter Eisentraut <peter.eisentraut@enterprisedb.com> wrote: > > Your patch filters out empty statements at the parse transformation > phase, so they are no longer present when you dump the body back out. > So your edits in the test expected files don't fit. Oh, somehow the tests aren't failing here, I'm not sure what I did wrong. > I suggest we just prohibit empty statements at the parse stage. I don't > see a strong reason to allow them, and if we wanted to, we'd have to do > more work, e.g., in ruleutils.c to print them back out correctly. I always thought extraneous semicolons were tokens to be ignored, which happens to be internally implemented as empty statements, so deparsing them is not required, similar to deparsing extraneous whitespaces. If the spec says otherwise then I agree it's not worth implementing, but otherwise I'm not sure if it's really helpful to error out.
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