Re: Question: drop database problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ben Kim <bkim(at)coe(dot)tamu(dot)edu>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Question: drop database problem
Date: 2004-10-26 03:13:39
Message-ID: 3852.1098760419@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Ben Kim <bkim(at)coe(dot)tamu(dot)edu> 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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message rray 2004-10-26 13:54:49 How to relocate temporary files
Previous Message Nikhil Parva 2004-10-26 02:47:29 unregister