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 0A7903A42BD for ; Tue, 26 Oct 2004 04:13:48 +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 79859-04 for ; Tue, 26 Oct 2004 03:13:46 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 947213A42AF for ; Tue, 26 Oct 2004 04:13:45 +0100 (BST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id i9Q3DdQT003853; Mon, 25 Oct 2004 23:13:39 -0400 (EDT) To: Ben Kim Cc: pgsql-admin@postgresql.org Subject: Re: Question: drop database problem In-reply-to: References: Comments: In-reply-to Ben Kim message dated "Mon, 25 Oct 2004 21:41:18 -0500" Date: Mon, 25 Oct 2004 23:13:39 -0400 Message-ID: <3852.1098760419@sss.pgh.pa.us> From: Tom Lane 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: 200410/346 X-Sequence-Number: 15339 Ben Kim writes: > I'm starting it with something like the following, as root in /etc/init.d > script. > su pgsql -c "/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data > -p /usr/local/pgsql/bin/postmaster start" > And pgsql has PGDATA3 defined in .cshrc. su is most likely executing its -c command with /bin/sh, which will pay zero attention to .cshrc. You may need to set up a .profile as well as .cshrc. Also, I think that su won't cause *any* of these setup scripts to be executed unless you use the "-" or "-l" options; a bare su just runs the command in your current root environment. This stuff varies across different Unix variants, but it's uniformly a source of gotchas :-(. Read your su and shell man pages carefully. > Will I have to shut down the server and restart it (introduce PGDATA3 > properly) before I can drop that particular database? Yeah. That part's not so hard: if you restart the postmaster manually then it will inherit your interactive variables. But I do *not* recommend that, because it'll break after your next reboot. You need to do the legwork to be sure that the variables show up in the basic boot-time context. Again, this definitely sucks, and we are moving away from it as fast as we can. But that's where things stand in current releases. regards, tom lane