Re: psql variables - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: psql variables
Date
Msg-id 200402091029.53881.peter_e@gmx.net
Whole thread Raw
In response to psql variables  (Neil Conway <neilc@samurai.com>)
Responses Re: psql variables  (Neil Conway <neilc@samurai.com>)
List pgsql-hackers
Neil Conway wrote:
> Recently, I was surprised to learn that psql variables are case
> sensitive.

like shell variables

> Furthermore, there is no error when one attempts to '\set'
> a non-existent variable

Well, how are you going to set a new variable if not this way?

> One possible justification for this behavior is that it allows a
> simple naming convention to distinguish user-defined variables from
> psql-internal variables. Is that the case?

Yes, upper-case names are reserved.  This is documented.

> While we're on the subject, there are some other design choices in
> this area that seem a bit unfortunate. For example, we don't error
> out on references to undefined variables

like shell variables

> Also, the user can go ahead and overwrite
> the value of built-in variables like HOST and PORT

like shell variables



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Linking the previously separated documentation
Next
From: Michael Glaesemann
Date:
Subject: Re: Linking the previously separated documentation