Re: ERROR: tablespace "archive2" is not empty

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Josip Rodin <joy+pgsql(at)entuzijast(dot)net>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-general(at)postgresql(dot)org
Subject: Re: ERROR: tablespace "archive2" is not empty
Date: 2015-10-19 15:24:10
Message-ID: 1000.1445268250@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Josip Rodin <joy+pgsql(at)entuzijast(dot)net> writes:
> On Mon, Oct 19, 2015 at 11:42:38AM +0200, Andres Freund wrote:
>>>> That's the wrong query. The files on disk are relefilenodes not
>>>> oids. Try WHERE pg_relation_filenode(oid) IN ...

> Oh, sorry, but yet again, there's just nothing there:

> % sudo -H -u postgres psql mydb -c "SELECT oid, relname, relkind FROM pg_catalog.pg_class WHERE pg_relation_filenode(oid) IN (7877054, 7877056);"
> oid | relname | relkind
> -----+---------+---------
> (0 rows)

Seeing that those files are all of similar date, I wonder if they are
tables that got orphaned in a crash, ie, the pg_class rows were removed
but the backend crashed before physically unlinking the files.

Anyway, if you've satisfied yourself that there are no pg_class entries
for these files, you could just manually remove the files.

I concur with Adrian's nearby suggestion of checking for rows with
reltablespace matching the tablespace's OID before you do anything
drastic, though.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Josip Rodin 2015-10-19 15:28:40 Re: ERROR: tablespace "archive2" is not empty
Previous Message Adrian Klaver 2015-10-19 15:23:24 Re: ERROR: tablespace "archive2" is not empty