Re: Minor DROP TABLESPACE issue - Mailing list pgsql-hackers

From Gavin Sherry
Subject Re: Minor DROP TABLESPACE issue
Date
Msg-id Pine.LNX.4.58.0406191115050.11419@linuxworld.com.au
Whole thread Raw
In response to Minor DROP TABLESPACE issue  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Minor DROP TABLESPACE issue
List pgsql-hackers
On Fri, 18 Jun 2004, Tom Lane wrote:

> Although DROP TABLESPACE can detect tables existing in the target
> tablespace, it doesn't have any way to detect schemas that reference
> that tablespace as their default tablespace.  Thus you can get
> implementation-level failures like this one:
>

Of course. Never thought of that one.

> The fact that it fails isn't a big problem, but the error message is
> pretty unclear if you're unfamiliar with the implementation.
>
> The same problem would exist with respect to a database's default
> tablespace, except that a database will always have its system catalogs
> stored there and so the file-level check prevents dropping the
> tablespace.

Is it really that bad? NamespaceCreate() could just touch a file at
pg_tablespaces/<tablespaceoid>/<MyDatabaseId>/<namespace oid> and
RemoveSchema() could remove it.

Is there anything ugly that I've missed?

Gavin


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Minor DROP TABLESPACE issue
Next
From: "Scott Marlowe"
Date:
Subject: Re: email browser?