Re: psql variables

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql variables
Date: 2004-02-09 07:20:47
Message-ID: 10659.1076311247@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Neil Conway <neilc(at)samurai(dot)com> writes:
> The historical origins of the feature are no excuse for its
> deficiencies.

On the other hand, the alleged deficiencies are not bad enough to
justify making non-backwards-compatible changes. If we were getting
routine complaints from the field I might be willing to break things in
order to address the issue. But we're not --- AFAIR you are the first
to raise the point at all.

> On second thought, there's another alternative. Rather than improving
> \set, we could invent a new mechanism for setting psql-internal
> variables, and leave the \set stuff to user-defined variables.

I was toying with the idea of inventing a "\declare foo" command
(which would error out if the variable foo already exists), along with
an optional setting that makes psql complain about either use of or
assignment to an undeclared variable. As long as latter setting is
false the behavior is backwards-compatible. By setting it true you get
the sort of error checking you're after.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Conway 2004-02-09 07:22:23 Re: psql tab completion & USERSET vars
Previous Message Neil Conway 2004-02-09 07:13:21 Re: psql variables