Re: ERROR: tablespace "archive2" is not empty

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Josip Rodin <joy(at)entuzijast(dot)net>, Josip Rodin <joy+pgsql(at)entuzijast(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ERROR: tablespace "archive2" is not empty
Date: 2015-10-19 18:15:08
Message-ID: 5625332C.8050204@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/19/2015 10:26 AM, Josip Rodin wrote:
>
>
> On 19. listopada 2015. 17:46:19 CEST, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> wrote:
>> On 10/19/2015 08:28 AM, Josip Rodin wrote:
>>> On Mon, Oct 19, 2015 at 08:23:24AM -0700, Adrian Klaver wrote:
>>>> On 10/19/2015 07:56 AM, Josip Rodin wrote:
>>>>> On Mon, Oct 19, 2015 at 07:38:32AM -0700, Adrian Klaver wrote:
>>>>>> What happens if you do?:
>>>>>>
>>>>>> select oid, * from pg_tablespace ;
>>>>>
>>>>> mydb=> select oid, * from pg_tablespace where spcname = 'archive2';
>>>>> oid | spcname | spcowner | spclocation | spcacl |
>> spcoptions
>>>>>
>> ---------+----------+----------+----------------------+--------+------------
>>>>> 7849107 | archive2 | 10 | /media/archive2/psql | |
>>>>> (1 row)
>>>>>
>>>>>> select * from pg_class where reltablespace = <archive2 oid>;
>>>>>
>>>>> mydb=> select * from pg_class where reltablespace = 7849107;
>>>>> relname | relnamespace | reltype | reloftype | relowner | relam |
>> relfilenode | reltablespace | relpages | reltuples | reltoastrelid |
>> reltoastidxid | relhasindex | relisshared | relpersistence | relkind |
>> relnatts | relchecks | relhasoids | relhaspkey | relhasrules |
>> relhastriggers | relhassubclass | relfrozenxid | relacl | reloptions
>>>>>
>> ---------+--------------+---------+-----------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+-------------+-------------+----------------+---------+----------+-----------+------------+------------+-------------+----------------+----------------+--------------+--------+------------
>>>>> (0 rows)
>>>>>
>>>>> It's there, but it's not there-there :)
>>>>>
>>>>
>>>> Should have added.
>>>>
>>>> What does a listing of pg_tblspc/ in your $PGDATA directory show?
>>>
>>> Ah, I forgot to mention. 7849107 is symlinked to
>> /media/archive2/postgresql,
>>
>> Except what you showed in you first post was:
>>
>> /media/ssd/archive2/postgresql
>>
>> Note the /media/ssd/*
>
> Sorry, that's another typo. It's the latter. The symlink is indeed pointing to the 5 GB of leftovers.

This:

% sudo find /media/ssd/archive2/ -type f -ls
36962439 393940 -rw------- 1 postgres postgres 403390464 Jun 27 2014
/media/ssd/archive2

is a typo or is there another symlink involved?

So, is there anything at /media/archive2/psql?

Or more to the point how did spclocation and the symlink get to be
different?

>
>>> so the symlink is referencing a real directory, and spclocation is
>> broken
>>> because that doesn't exist. But that sounds like an -ENOENT and not
>>> -ENOPERM, no?
>>>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Josip Rodin 2015-10-19 18:25:20 Re: ERROR: tablespace "archive2" is not empty
Previous Message Josip Rodin 2015-10-19 17:26:10 Re: ERROR: tablespace "archive2" is not empty