Re: Changing the continuation-line prompt in psql? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Changing the continuation-line prompt in psql?
Date
Msg-id 5703.1304090559@sss.pgh.pa.us
Whole thread Raw
In response to Re: Changing the continuation-line prompt in psql?  (Magnus Hagander <magnus@hagander.net>)
Responses Re: Changing the continuation-line prompt in psql?  ("David E. Wheeler" <david@kineticode.com>)
List pgsql-hackers
Magnus Hagander <magnus@hagander.net> writes:
> On Fri, Apr 29, 2011 at 17:09, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> ... Two different possible changes were suggested:
>> 
>> * Drop the database name from PROMPT2, so you see
>> 
>>        postgres=>
>>        ->

> Definite -1 on that option - your query no longer lines up, and if you
> then for example open it in an editor, indentation changes.

Yeah, there is that.  I just went over to see what the competition does
here, and it looks like this:

mysql> select 2   -> +2   -> + 'foo   '> bar   '> baz'   -> "quoted   "> identifier"   -> /*  /*> comment */   -> ;

AFAICT the initial prompt is always "mysql> ", so they don't have to
think hard about how many spaces to insert to make it line up.  But
we could certainly invent a prompt escape that means "as many spaces
as there are characters in the current DB name".  (Or maybe we should
try to generalize that idea, so you could get similar behavior for
custom prompts involving usernames etc?)
        regards, tom lane


pgsql-hackers by date:

Previous
From: Joshua Berkus
Date:
Subject: Re: branching for 9.2devel
Next
From: "David E. Wheeler"
Date:
Subject: Re: Changing the continuation-line prompt in psql?