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