Re: PSQL commands: \quit_if, \quit_unless

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>, PostgreSQL <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PSQL commands: \quit_if, \quit_unless
Date: 2016-11-28 20:00:41
Message-ID: CAFj8pRCfPhaSRzC09N0Eh9Q2JK1gvLz0oN5P10i1QhSNPZyP4w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2016-11-28 20:03 GMT+01:00 Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>:

>
> Hello Corey,
>
> This patch adds two very simple psql commands: \quit_if and \quit_unless.
>>
>
> A few comments about the feature design:
>
> I'm unsure about the name, esp with '_'. There are some \lo_* commands,
> but others rely on pasted words (\crosstabview, \errverbose, ...).
>

There are not any other conditional statements - so using "_" can be better

>
> I'm wondering if an simplistic interpreted \if \elsif/\else \fi would make
> more sense:
>

The \if \ese \elseif is not in contradiction with \quit_if - \if is more
generic, \quit_if is simple for implementation, one liner, and best readable

Pavel

>
> Quitting seems a little bit definitive, and means that if I have some
> alternatives then I have to have something that relaunch another script
> outside...
>
> When \includes are process, does \quit stop the include or the full
> script. I'm afraid it is the script.
>
> Now probably an \if... would have also some drawbacks, but ISTM that there
> could be less of them.
>
> There is no test provided with the patch.
>
> --
> Fabien.
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Gilles Darold 2016-11-28 20:00:47 Re: Patch to implement pg_current_logfile() function
Previous Message Joshua D. Drake 2016-11-28 19:53:41 Re: Time to up bgwriter_lru_maxpages?