Re: Custom prompt

Поиск
Список
Период
Сортировка
От craig@gtek.biz
Тема Re: Custom prompt
Дата
Msg-id 1348584609.41445979@webmail.gtek.biz
обсуждение исходный текст
Ответ на Re: Custom prompt  (craig@gtek.biz)
Список pgsql-general

> Aha, exactly what I was looking for. Thanks!

  Well I certainly feel dumb. The answer is right in the documentation, I just
failed to find it (I did look first). The system-wide psqlrc, and the ~/.psqlrc
files fit the bill perfectly, and the documentation explains it all quite
nicely. I accomplished my main goal better than I had even hoped. Our two
production servers are locked down and do not accept external connections. I
wanted to customize the prompt so I could tell at a glance which I was on. The
documentation even explains how to have a tcsh-like color prompt, which I use
quite extensively in bash. I now have a yellow prompt on one server, and a red
one on the other. How cool is that!

my system-wide psqlrc (/etc/sysconfig/pgsql/psqlrc on CentOS):

\set PROMPT1 %[%033[1;31;40m%]%n%[%033[0m%]@%/%R%# >

This puts the username in red, followed by @DBNAME in white, both on a black
background. I'll probably tweak this as I go, but this works for now.

Thanks to all for the help!




Sent - Gtek Web Mail

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Running CREATE only on certain Postgres versions
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: plpython2u not getting any output -> on independent script I get the desired output