Re: psql - add ability to test whether a variable exists

Fabien COELHO <coelho@cri.ensmp.fr>

From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: PostgreSQL Developers <pgsql-hackers@postgresql.org>
Date: 2017-08-26T17:55:34Z
Lists: pgsql-hackers

Attachments

> Any colon prefixed syntax can be made to work because it is enough for the 
> lexer to detect and handle... so
>
>  :{defined varname}
>
> may be an option, although I do not like the space much because it adds some 
> fuzzyness in the lexer which has to process it. It is probably doable, 
> though. I like having a "?" because there is a question. Other
> suggestions somehow in line with your proposal could be
>  :{?varname}
>  :{varname?}
> what do you think?

Here is a version with the :{?varname} syntax.

-- 
Fabien.

Commits

  1. Provide a test for variable existence in psql