Skip site navigation (1) Skip section navigation (2)

Re: environment variables

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: "Walker, Jed S" <Jed_Walker(at)cable(dot)comcast(dot)com>
Cc: "'pgsql-novice(at)postgresql(dot)org'" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: environment variables
Date: 2005-03-21 03:35:52
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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:

Michael Fuhr

In response to

pgsql-novice by date

Next:From: Keith WorthingtonDate: 2005-03-21 14:20:32
Subject: Re: output a single and double quote in a string
Previous:From: Tom LaneDate: 2005-03-21 03:15:40
Subject: Re: environment variables

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group