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: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Corey Huinker <corey(dot)huinker(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PSQL commands: \quit_if, \quit_unless
Date: 2016-12-04 16:55:11
Message-ID: CAFj8pRAkiBkDVmao+TEU=Y28dv1C12xOUVF20m5VGD-0oEwKDg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2016-12-04 17:35 GMT+01:00 Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>:

>
> Hello Pavel,
>
> Some possibilities from pgbench can have sense in psql too - generating
>> some random numbers from a range.
>>
>
> Could you expand on the use case where this would be useful?
>

writing test cases

>
> In the end we use one parser for psql and for pgbench.
>>
>
> Note that "master" lexer is already shared, thanks to Tom, so as to detect
> consistently where a query ends.
>
> I agree, so step 2 should be enough, and I accept so there is opened door
>> for any future enhancing.
>>
>
> Good, because that was the idea:-)
>
> We can implement some client side boolean functions (similar to pgbench
>> functions that can cover often tasks: version_less, version_greather,
>> user_exists, tables_exists, index_exists, variable_exists, schema_exists,
>>
>
> Yes, that is a possibility, but this can already be queried into a
> :-variable, so it is less indispensable.

can you show some examples, please?

Regards

Pavel

>
>
> --
> Fabien.
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joseph Brenner 2016-12-04 17:14:58 Re: Select works only when connected from login postgres
Previous Message Fabien COELHO 2016-12-04 16:35:55 Re: PSQL commands: \quit_if, \quit_unless