Re: \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)
Corey Huinker <corey.huinker@gmail.com>
From: Corey Huinker <corey.huinker@gmail.com>
To: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Greg Stark <stark@mit.edu>,
Erik Rijkers <er@xs4all.nl>, Robert Haas <robertmhaas@gmail.com>, Daniel Verite <daniel@manitou-mail.org>, Jim Nasby <Jim.Nasby@bluetreble.com>,
PostgreSQL <pgsql-hackers@postgresql.org>, pgsql-hackers-owner@postgresql.org
Date: 2017-03-02T19:47:46Z
Lists: pgsql-hackers
Attachments
- 0001.if_endif.v20.diff (text/plain) patch v20
> > > For me, it is only slightly better: I think that for helping understanding > and maintenance, the automaton state transitions should be all clear and > loud in just one place, so I would really like to see a single common > structure: > > if (is "if") switch on all states; > else if (is "elif") switch on all states; > else if (is "else") switch on all states; > else if (is "endif") switch on all states; > > And minimal necessary error handling around that. > > v20: attempt at implementing the switch-on-all-states style.
Commits
-
Support \if ... \elif ... \else ... \endif in psql scripting.
- e984ef5861df 10.0 landed
-
Add a "void *" passthrough pointer for psqlscan.l's callback functions.
- 895e36bb3f36 10.0 landed