Re: \if, \elseif, \else, \endif (was Re: PSQL commands:\quit_if, \quit_unless) - Mailing list pgsql-hackers

From Corey Huinker
Subject Re: \if, \elseif, \else, \endif (was Re: PSQL commands:\quit_if, \quit_unless)
Date
Msg-id CADkLM=f6ELXZOmW9UU3vyYu3jzTbh2o2178r7+wt2emN+DWmig@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] \if, \elseif, \else, \endif (was Re: PSQL commands:\quit_if, \quit_unless)  ("Daniel Verite" <daniel@manitou-mail.org>)
Responses Re: \if, \elseif, \else, \endif (was Re: PSQL commands:\quit_if, \quit_unless)  (Corey Huinker <corey.huinker@gmail.com>)
List pgsql-hackers
On Mon, Mar 27, 2017 at 3:25 PM, Fabien COELHO <coelho@cri.ensmp.fr> wrote:

And here you go

Patch applies cleany, make check ok. Looks pretty good.

A minor detail I have just noticed, sorry: now that options are discarded by functions, some string variable declarations should be moved back inside the active branch. You moved them out because you where sharing the variables between the active & inactive branches, but this is no longer necessary, and the project practice seems to declare variables just where they are needed. That would be pattern in d, encoding in encoding, fname in f and g and include and out and s, prefix in gset, opt in help, opt* in lo and pset and set, arg* in prompt, env* in setenv... and maybe a few others.

--
Fabien.

done:
encoding f g gset help include lo out prompt pset s set setenv sf sv t T timing unset watch x z ! ?

weird cases where they're both still needed:
d write

0001+0002 patch primarily for ease of review. will be following with a single v28 patch shortly.
Attachment

pgsql-hackers by date:

Previous
From: Beena Emerson
Date:
Subject: Re: increasing the default WAL segment size
Next
From: Corey Huinker
Date:
Subject: Re: \if, \elseif, \else, \endif (was Re: PSQL commands:\quit_if, \quit_unless)