Re: [psql] Setting the PROMPT on command line - Mailing list pgsql-patches

From Neil Conway
Subject Re: [psql] Setting the PROMPT on command line
Date
Msg-id 1097126144.13817.110.camel@localhost.localdomain
Whole thread Raw
In response to Re: [psql] Setting the PROMPT on command line  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [psql] Setting the PROMPT on command line
List pgsql-patches
On Thu, 2004-10-07 at 13:46, Tom Lane wrote:
> [ 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.

Indeed, that is true -- that's the better fix IMHO. Barring any
objections I'll commit this fix before end-of-day today.

> > 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?
[...]
> Would it be simple to change?

The main complication is that there is a command-line argument that
instructs psql not to read psqlrc; that means the easy fix of just
reading psqlrc before processing command-line arguments won't work.
Still shouldn't be too complicated to fix (e.g. postpone the -v settings
until we've processed psqlrc but do the rest of the command-line arg
processing immediately), but I'm content to leave it for 8.1

-Neil



pgsql-patches by date:

Previous
From: Euler Taveira de Oliveira
Date:
Subject: pg_config translation to pt_BR
Next
From: Peter Eisentraut
Date:
Subject: Re: pg_restore - added documentation