X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 025BA329EC6 for ; Wed, 8 Sep 2004 09:05:37 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 62766-02 for ; Wed, 8 Sep 2004 08:05:30 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id B26C6329EBD for ; Wed, 8 Sep 2004 09:05:30 +0100 (BST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i8885SCn063378 for ; Wed, 8 Sep 2004 08:05:28 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i887aJaF054275 for pgsql-admin@postgresql.org; Wed, 8 Sep 2004 07:36:19 GMT From: Kostis Mentzelos X-Newsgroups: comp.databases.postgresql.admin Subject: Re: Alternate db location Date: Wed, 08 Sep 2004 10:37:50 +0300 Organization: Hub.Org Networking Services Lines: 39 Message-ID: References: <13140.1094599310@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org User-Agent: Mozilla Thunderbird 0.5 (X11/20040208) X-Accept-Language: en-us, en In-Reply-To: <13140.1094599310@sss.pgh.pa.us> To: pgsql-admin@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/101 X-Sequence-Number: 14804 I believe that su user -c command throws away the environment su - user -c command executes the user .profile Tom Lane wrote: > "Bender, Cheryl" 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) >