Re: Adding the host name to the PgSQL shell - Mailing list pgsql-general

From Madison Kelly
Subject Re: Adding the host name to the PgSQL shell
Date
Msg-id 4A2D4ACA.3020204@alteeve.com
Whole thread Raw
In response to Re: Adding the host name to the PgSQL shell  (Scott Mead <scott.lists@enterprisedb.com>)
Responses Re: Adding the host name to the PgSQL shell
List pgsql-general
Scott Mead wrote:
>
>
>
> On Mon, Jun 8, 2009 at 12:44 PM, Madison Kelly <linux@alteeve.com
> <mailto:linux@alteeve.com>> wrote:
>
>     Hi all,
>
>      I work on a development and production server, and I am always
>     double-checking myself to make sure I am doing something on the
>     right server.
>
>      Is there a way, like in terminal shells, to change the PgSQL
>     shell's prompt from 'db=>' to something like 'host@db=>'? I'm on
>     PgSQL 8.1 (server on Debian) and 8.3 (devel on Ubuntu), in case it
>     matters.
>
>
> You certainly can do this, very similar to PS1 on linux with bash:
>
> http://www.postgresql.org/docs/8.1/static/app-psql.html#APP-PSQL-PROMPTING
>
> --Scott

That works like a charm, thank you!

Next question though;

How can I get it to save my custom prompt across sessions/server
restarts? It there something equivalent to '.bash_profile'?

Madi

pgsql-general by date:

Previous
From: Scott Mead
Date:
Subject: Re: Adding the host name to the PgSQL shell
Next
From: Scott Mead
Date:
Subject: Re: Adding the host name to the PgSQL shell