Re: How to set default database

From: Joshua Tolley <eggyknap(at)gmail(dot)com>
To: Krzysztof Walkiewicz <bars0(at)op(dot)pl>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: How to set default database
Date: 2010-02-04 23:20:29
Message-ID: 4b6b5650.0d1abc0a.408f.27e8@mx.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Thu, Feb 04, 2010 at 07:37:30PM +0100, Krzysztof Walkiewicz wrote:
> Hello!
>
> I created database "krzysztof" for practice postgresql. After few days i
> deleted that database and i created the next one "cwiczebna". Now when
> I type "psql" i get strange info, something like: "CRITICAL: base
> "krzysztof" don't exist". Now i need to type "psql cwiczebna" to log in
> to new database. How to set the default database or connect
> automatically to "cwiczebna" database when I type "psql" in terminal. I
> am using Debian Lenny distro.

You can set the PGDATABASE environment variable to tell psql which database to
log into.

--
Joshua Tolley / eggyknap
End Point Corporation
http://www.endpoint.com

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Krešimir Križanović 2010-02-05 10:47:58 trouble with an older version of postgresql
Previous Message Michael Lush 2010-02-04 21:18:03 Re: Any way to recover a lost db..