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: PSQL commands: \quit_if, \quit_unless
Date: 2016-11-28 19:03:16
Message-ID: alpine.DEB.2.20.1611281954340.14221@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


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, ...).

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

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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nico Williams 2016-11-28 19:23:43 Re: Tackling JsonPath support
Previous Message Alvaro Herrera 2016-11-28 18:57:35 Re: Fix comment in build_simple_rel