help! default database for user

Started by philip johnsonover 23 years ago4 messagesgeneral
Jump to latest
#1philip johnson
philip.johnson@atempo.com

is it possible to assign a default database for a user
example: database B for user A

so when I will use psql it will not say thet database A does not
exists

thanks in advance

#2Martijn van Oosterhout
kleptog@svana.org
In reply to: philip johnson (#1)
Re: help! default database for user

On Thu, Jan 02, 2003 at 07:27:21PM +0100, philip johnson wrote:

is it possible to assign a default database for a user
example: database B for user A

so when I will use psql it will not say thet database A does not
exists

The easiest way I can think of is to set the PGDATABASE environment variable
in the .bash_profile of the user. then psql will use that instead of the
username.

HTH,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/

Show quoted text

Support bacteria! They're the only culture some people have.

#3Medi Montaseri
medi.montaseri@intransa.com
In reply to: philip johnson (#1)
Re: help! default database for user

An extension of .bash_profile would be /etc/profile, a system wide point of
customization with a few line of code that export PGDATABASE based on
userid or
groupid or whatever ....

Martijn van Oosterhout wrote:

Show quoted text

On Thu, Jan 02, 2003 at 07:27:21PM +0100, philip johnson wrote:

is it possible to assign a default database for a user
example: database B for user A

so when I will use psql it will not say thet database A does not
exists

The easiest way I can think of is to set the PGDATABASE environment variable
in the .bash_profile of the user. then psql will use that instead of the
username.

HTH,

#4philip johnson
philip.johnson@atempo.com
In reply to: Medi Montaseri (#3)
Re: help! default database for user

pgsql-general-owner@postgresql.org wrote:

Objet : Re: [GENERAL] help! default database for user

An extension of .bash_profile would be /etc/profile, a system wide
point of customization with a few line of code that export PGDATABASE
based on userid or
groupid or whatever ....

Martijn van Oosterhout wrote:

On Thu, Jan 02, 2003 at 07:27:21PM +0100, philip johnson wrote:

is it possible to assign a default database for a user
example: database B for user A

so when I will use psql it will not say thet database A does not
exists

The easiest way I can think of is to set the PGDATABASE environment
variable in the .bash_profile of the user. then psql will use that
instead of the username.

HTH,

---------------------------(end of
broadcast)--------------------------- TIP 4: Don't 'kill -9' the
postmaster

thanks to all
It works great