| From: | Kostis Mentzelos <mentzelos(at)gmx(dot)net> |
|---|---|
| To: | pgsql-admin(at)postgresql(dot)org |
| Subject: | Re: Alternate db location |
| Date: | 2004-09-08 07:37:50 |
| Message-ID: | chmcpi$1ka9$1@news.hub.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-admin |
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(at)mriresearch(dot)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(at)postgresql(dot)org)
>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | k b | 2004-09-08 12:25:13 | replication between mysql 3.23 and postgresql 7.2.4? |
| Previous Message | Tom Lane | 2004-09-08 04:41:56 | Re: When will my database crash? |