pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kostis Mentzelos <mentzelos@gmx.net>
To: pgsql-admin@postgresql.org
Subject: Re: Alternate db location
Date: Wed, 08 Sep 2004 10:37:50 +0300
Message-ID: <chmcpi$1ka9$1@news.hub.org> (raw)
In-Reply-To: <13140.1094599310@sss.pgh.pa.us>
References: <D5DB5D0D27171247AFEC9648EE98752F03220125@KCEX2KV1.mri-kc.int>
	<13140.1094599310@sss.pgh.pa.us>

I believe that su user -c command throws away the environment
su - user -c command executes the user .profile


Tom Lane wrote:
> "Bender, Cheryl" <cbender@mriresearch.org> writes:
> 
>>I need to add an alternate db location for my 7.3.4 server (running on
>>FreeBSD 5.2 Release)
>>I thought I did everything according to the administrator's guide, but I
>>fail at createdb.
> 
> 
> How are you starting the postmaster, exactly?
> 
> A lot of people use start scripts that boil down to something like
> 
> 	su - postgres -c "postmaster ..."
> 
> The "su -" means "throw away the existing environment variables and
> adopt the environment that would be obtained by logging in from scratch
> as postgres".  So it doesn't matter *what* you do before executing such
> a script; the environment variables you have won't affect what the
> postmaster gets.
> 
> What you have to do to play with such a script is put the export or
> setenv command into whatever "~postgres/.profile" file will be read by
> the standard shell that su will invoke.  This is what you want anyway,
> really, since anything you do any other way will be lost in a reboot.
> 
> This'll all get a lot easier in 8.0, thankfully (no more dependence
> on environment variables).
> 
> 			regards, tom lane
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
> 



view thread (4+ messages)  latest in thread

Message-ID: <chmcpi$1ka9$1@news.hub.org>
Permalink:  ../chmcpi$1ka9$1@news.hub.org/
Also on:    postgresql.org/message-id/chmcpi$1ka9$1@news.hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: mentzelos@gmx.net
  Subject: Re: Alternate db location
  In-Reply-To: <chmcpi$1ka9$1@news.hub.org>
  References: <D5DB5D0D27171247AFEC9648EE98752F03220125@KCEX2KV1.mri-kc.int> <13140.1094599310@sss.pgh.pa.us> <chmcpi$1ka9$1@news.hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox