Re: [HACKERS] Undefined psql variables - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Undefined psql variables
Date
Msg-id 11154.1485193991@sss.pgh.pa.us
Whole thread Raw
In response to [HACKERS] Undefined psql variables  (Corey Huinker <corey.huinker@gmail.com>)
Responses Re: [HACKERS] Undefined psql variables  (Corey Huinker <corey.huinker@gmail.com>)
Re: [HACKERS] Undefined psql variables  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: Undefined psql variables  (Corey Huinker <corey.huinker@gmail.com>)
List pgsql-hackers
Corey Huinker <corey.huinker@gmail.com> writes:
> I was giving some thought to how psql handles undefined variables.
> I would like an option where either psql can provide an alternate value
> when an undefined variable is referenced, or a way to detect that a
> specific variable is undefined and replace it with a defined variable.

This seems pretty bizarre.  What's the use case?  Why would it not
be better to build the behavior out of other spare parts, along the
lines of COALESCE or perhaps
     \if not defined(x)     \set x y     \fi

Obviously the \if stuff is things we don't have yet either, but
it seems less likely to have surprising side-effects.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Corey Huinker
Date:
Subject: Re: [HACKERS] Undefined psql variables
Next
From: Greg Stark
Date:
Subject: Re: [HACKERS] Online enabling of page level checksums