Re: [psql] Setting the PROMPT on command line

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: Ingo van Lil <inguin(at)gmx(dot)de>, pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [psql] Setting the PROMPT on command line
Date: 2004-10-07 03:46:46
Message-ID: 23677.1097120806@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Neil Conway <neilc(at)samurai(dot)com> writes:
> On Thu, 2004-10-07 at 13:05, Tom Lane wrote:
>> I'm just wondering if the fix is in the right place. Doesn't the same
>> issue arise for other variables?

> Well, we don't manually set other variables in psql itself, with the
> exception of defining some default values before we process command-line
> args or psqlrc (see startup.c circa line 141) -- so in that case
> allowing the value to be overriden is fine.

[ eyeballs that... ] So a much simpler fix for Ingo's complaint would
be to move the default settings of PROMPT1 et al (lines 303-306) to the
vicinity of line 141. I can't see that skipping these setup operations
in the noninteractive case is worthwhile.

> On looking at the code closer though, I do see one related problem: we
> process command-line args before we read psqlrc, so psqlrc settings can
> override what was specified on the command-line. Shouldn't this happen
> in reverse?

I tend to agree, but it's somewhat debatable. Would it be simple to
change?

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Euler Taveira de Oliveira 2004-10-07 04:06:19 pg_config translation to pt_BR
Previous Message Reini Urban 2004-10-07 03:46:32 pg_ctl: WIN32 for CYGWIN also (services)