Re: \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
Cc: PostgreSQL <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)
Date: 2017-01-24 08:58:42
Message-ID: alpine.DEB.2.20.1701240957180.5072@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


>> I would suggest to assume false on everything else, and/or maybe to ignore
>> the whole if/endif section in such cases.
>
> +1, it also halves the number of values we have to support later.

After giving it some thought, I revise a little bit my opinion:

I think that if the value is evaluated to TRUE or FALSE, then fine. If it
is anything else, then an error is raised (error message shown), which
should also stop the script on "ON_ERROR_STOP", and if not the script
continues with assuming the value was FALSE.

--
Fabien.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Shruti Rawal 2017-01-24 09:20:55 PostgreSQL 8.2 installation error on Windows 2016 server
Previous Message Kyotaro HORIGUCHI 2017-01-24 08:34:38 Re: Protect syscache from bloating with negative cache entries