Re: Changing the continuation-line prompt in psql?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Changing the continuation-line prompt in psql?
Дата
Msg-id 5703.1304090559@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Changing the continuation-line prompt in psql?  (Magnus Hagander <magnus@hagander.net>)
Ответы Re: Changing the continuation-line prompt in psql?  ("David E. Wheeler" <david@kineticode.com>)
Список 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 по дате отправления:

Предыдущее
От: Joshua Berkus
Дата:
Сообщение: Re: branching for 9.2devel
Следующее
От: "David E. Wheeler"
Дата:
Сообщение: Re: Changing the continuation-line prompt in psql?