Re: Error when trying to drop a tablespace - Mailing list pgsql-general

From Albe Laurenz
Subject Re: Error when trying to drop a tablespace
Date
Msg-id D960CB61B694CF459DCFB4B0128514C2023A91EA@exadv11.host.magwien.gv.at
Whole thread Raw
In response to Error when trying to drop a tablespace  (Cyril SCETBON <scetbon@echo.fr>)
Responses Re: Error when trying to drop a tablespace  (Cyril SCETBON <scetbon@echo.fr>)
List 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;
>
> postgres=# SELECT t.relname AS catalog, d.objid AS oid_dependent
> postgres-# FROM pg_catalog.pg_class t JOIN
> postgres-#      pg_catalog.pg_depend d ON (t.oid = d.classid)
> postgres-# WHERE refobjid = 100456;
>  catalog | oid_dependent
> ---------+---------------
> (0 rows)
>
> nothing...

Hmm.
Find out the directory:

SELECT oid, spclocation FROM pg_catalog.pg_tablespace WHERE spcname = 'my_tbs';

is there anything in this directory?

Yours,
Laurenz Albe

pgsql-general by date:

Previous
From: Matthew Wakeling
Date:
Subject: Re: [PERFORM] Migration Articles.. ???
Next
From: "Michael Shulman"
Date:
Subject: Re: inserting to a multi-table view