Thread: Dependency tracking while dropping a database.

Dependency tracking while dropping a database.

From
Date:
Hi,

Shudnt' dependency tracking prevent one from dropping
a database that has tables in it?

regds
mallah.


-----------------------------------------
Get your free web based email at trade-india.com.
   "India's Leading B2B eMarketplace.!"
http://www.trade-india.com/



Re: Dependency tracking while dropping a database.

From
"scott.marlowe"
Date:
On Tue, 10 Jun 2003 mallah@trade-india.com wrote:

>
> Hi,
>
> Shudnt' dependency tracking prevent one from dropping
> a database that has tables in it?

Not really.

Dependency tracking is more for things like dropping indexes when the
table that they depend on disappears, or dropping a sequence that was
created with the serial keyword when the table is dropped.

Preventing a database from being dropped is more the job of access
control.  I don't think there's any control over who can or can't drop a
database except for the default database creator or superuser.

Of course, since the superuser can type 'rm -Rf $PGDATA/*' you can't
really deny him, just make him work harder to do it.  I write a lot of
scripts though, and don't want any default interfacing to have to get done
to drop a database, so I'd prefer it be a non-default setting if any ever
added the ability to deny / grant the creator or superuser the ability to
drop a database.

My intuition tells me that good backups and a test environment are the
answer(s) to this problem.