Re: Variable substitution in psql backtick expansion
Fabien COELHO <coelho@cri.ensmp.fr>
From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Greg Stark <stark@mit.edu>, Daniel Verite <daniel@manitou-mail.org>,
Tom Lane <tgl@sss.pgh.pa.us>,
PostgreSQL Developers <pgsql-hackers@postgresql.org>,
"corey.huinker" <corey.huinker@gmail.com>
Date: 2017-04-11T07:07:44Z
Lists: pgsql-hackers
> I think so implementation of simple expression evaluation should not be > hard Indeed it is not hard, it is rather a matter of deciding what it should do, and the syntax to do it. > - really just - we can expect so any variable will be replaced by > const in expression > > Num (<|>|=|<=|>=) Num <> and != would seem handy as well. > Text (<|>|=|<=|>=) Text What would be the use case for handling TEXT? > not Bool, Bool (or|and) Bool Aka logical expressions. > and special operator "defined" I'm still not buying this suggestion at all because it does not look like SQL and I think that client-side expressions should be a simple subset of SQL expressions, which a "defined" operators is definitely not. >> Hmmm. I'm not sure I get it. The penalty I see is that it adds a dummy >> variable which must be given a sensible name, and for very short >> expressions this is not a win. But this is a minor point. > I know so it is not ideal - but the language with commands "\if", "\else" > ... is not ideal language. Sure. -- Fabien.
Commits
-
Add psql variables showing server version and psql version.
- a6c678f018d3 10.0 landed
- 9ae9d8c1549c 11.0 landed
-
Reformat psql's --help=variables output.
- 3955c8c4eda2 11.0 landed
-
Remove reinvention of stringify macro.
- cd6baed78150 10.0 landed
-
Allow psql variable substitution to occur in backtick command strings.
- f833c847b8fa 10.0 landed