Re: Error when trying to drop a tablespace

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Cyril SCETBON *EXTERN*" <scetbon(at)echo(dot)fr>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Error when trying to drop a tablespace
Date: 2008-06-17 12:01:23
Message-ID: D960CB61B694CF459DCFB4B0128514C20235EB3A@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Cyril SCETBON wrote:
> I get the following error :
>
> postgres=# DROP TABLESPACE IF EXISTS my_tbs;
> ERROR: tablespace "my_tbs" is not empty
>
> I've searched in pg_class and I'm not able to find a relation which
> refers to my_tbs with :
>
> postgres=# select * from pg_class where reltablespace=100456;
[...]
> (0 rows)
>
> 100456 has been found with :
>
> /oid2name -s|grep my_tbs
>
> Any idea ?

You can find the dependent objects with:

SELECT t.relname AS catalog, d.objid AS oid_dependent
FROM pg_catalog.pg_class t JOIN
pg_catalog.pg_depend d ON (t.oid = d.classid)
WHERE refobjid = 100456;

This will give you a list of system catalog tables and OIDs.
You can find out more about an dependent object by searching
for the OID in the system catalog.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message m laks 2008-06-17 12:03:07 Re: ERROR: missing FROM-clause entry for table on postgresql 8.1 not on 7.4; deleting from a join
Previous Message Markus Wollny 2008-06-17 11:52:23 Slony-I configuration problem, probably due to custom casts in 8.3