Re: BUG #8094: psql prompt variable and command substitution broken

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #8094: psql prompt variable and command substitution broken
Дата
Msg-id 8164.1366310921@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #8094: psql prompt variable and command substitution broken  (nyetter@gmail.com)
Ответы Re: BUG #8094: psql prompt variable and command substitution broken  (Noah Yetter <nyetter@gmail.com>)
Список pgsql-bugs
nyetter@gmail.com writes:
> My psql PROMPT1, set through /etc/sysconfig/pgsql/psqlrc, is the following:
> h:%M%040d:%/%040U:%n%040AC:%:AUTOCOMMIT:%040TX:%x%012%R%#%040

You did not show us exactly how you set that, but I speculate that you
weren't bothering to quote it.  9.2 is more consistent than prior
versions were about expanding :variable references in backslash
commands, which means that you'd better quote the reference to
:AUTOCOMMIT if you don't want it expanded on-the-spot before it goes
into the prompt string.  I'd suggest putting single quotes around the
argument of \set PROMPT1, viz

\set PROMPT1 'h:%M%040d:%/%040U:%n%040AC:%:AUTOCOMMIT:%040TX:%x%012%R%#%040'

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: nyetter@gmail.com
Дата:
Сообщение: BUG #8094: psql prompt variable and command substitution broken
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #8025: PostgreSQL crash (>= 9.1 64 bit)