Home > Linux, PostgreSQL, Uncategorized > PostgreSQL prompt with user, hostname , port, dbname and current timestamp

PostgreSQL prompt with user, hostname , port, dbname and current timestamp


bsms=# \set PROMPT1 '%[%033[1;33;40m%]%n@%M:%>::%/%R[%`date`]%[%033[0m%]%# '
bsms@[darkwater]:5432::bsms=[Wed Nov 30 01:14:48 EET 2011]# select now();
now
-------------------------------
2011-11-30 01:14:52.998601+02
(1 row)

bsms@[darkwater]:5432::bsms=[Wed Nov 30 01:14:53 EET 2011]#

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: