Re: psql variables

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Neil Conway <neilc(at)samurai(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql variables
Date: 2004-02-09 09:29:53
Message-ID: 200402091029.53881.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message veramente@libero.it 2004-02-09 10:40:36 Check for prepared statement
Previous Message Peter Eisentraut 2004-02-09 09:23:58 Re: [HACKERS] Linking the previously separated documentation