Re: environment variables - Mailing list pgsql-novice

From Michael Fuhr
Subject Re: environment variables
Date
Msg-id 20050321033552.GA16885@winnie.fuhr.org
Whole thread Raw
In response to environment variables  ("Walker, Jed S" <Jed_Walker@cable.comcast.com>)
List pgsql-novice
On Thu, Mar 17, 2005 at 12:57:16PM -0700, Walker, Jed S wrote:

> I've noticed postgres uses some environment variables such as $PGDATA. Is
> there a standard postgres environment variable for the current database?
>
> I'd like something where we can have aliases and such access the db without
> the user having to know what the name is
>
> alias sql='psql -d $PGDATABASE'

PGDATABASE should work.  Did you try setting it as an environment
variable?  That is, using "export" or "setenv", depending on what
shell you're using?

See "Environment" in the psql documentation and "Environment
Variables" in the libpq documentation.  Here are links to doc for
the latest release:

http://www.postgresql.org/docs/8.0/interactive/app-psql.html
http://www.postgresql.org/docs/8.0/interactive/libpq-envars.html

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

pgsql-novice by date:

Previous
From: Russell Smith
Date:
Subject: Re: [GENERAL] sql question
Next
From: Tom Lane
Date:
Subject: Re: environment variables