From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> |
Cc: | Greg Stark <stark(at)mit(dot)edu>, Daniel Verite <daniel(at)manitou-mail(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Variable substitution in psql backtick expansion |
Date: | 2017-04-11 07:04:52 |
Message-ID: | CAFj8pRDmYzBLaG9ZE=67Lh7P-Myhs8Gp+G5C012Zhvjm1t9q3A@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
2017-04-11 8:56 GMT+02:00 Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>:
>
> Hello Pavel,
>
> I think so some local expression evaluation could be - but it should not be
>> placed in \if statement
>>
>
> Why?
>
> \expr issupported :VERSION_NUM >= 10000
>>
>
> Hmmm. Although I do not buy this, it could work as a replacement for \set
> which it seems cannot be upgraded because some people may rely on it to
> just store whatever comes after it in a variable.
>
> Maybe \setexpr or \set_expr because it is setting a variable and there is
> already a \set.
>
> \if :issuported
>>
>> maybe \if can support the basic logic predicates NOT, OR, AND -
>>
>
> ISTM that "NOT" is a minimal requirement, and the easy one.
>
> Note that OR & AND imply a syntax tree, handling parentheses, not in the
> same league.
>
> but the operands can be only evaluated variables.
>>
>
> Why?
>
> If your idea was to be followed, it seems to suggest two parsers with
> different constraints, one for the suggested "\expr" and one for the
> existing "\if".
>
> I think that if there is a client expression lexer/parser/executor, there
> would be just one of them for one syntax. Two is one too many.
in this moment the I am thinking on concept level - \setexpr sounds better
- sure
Important idea is integrating some simple calculus (hard to mark it as
language) used for client side operations only. It can have own commands,
and maybe it can be used in \if command
Regards
Pavel
>
>
> --
> Fabien.
>
From | Date | Subject | |
---|---|---|---|
Next Message | Fabien COELHO | 2017-04-11 07:07:44 | Re: Variable substitution in psql backtick expansion |
Previous Message | Pavel Stehule | 2017-04-11 06:58:14 | Re: Variable substitution in psql backtick expansion |