Re: ERROR: tablespace "archive2" is not empty - Mailing list pgsql-general

From Josip Rodin
Subject Re: ERROR: tablespace "archive2" is not empty
Date
Msg-id 20151019152840.GA6199@entuzijast.net
Whole thread Raw
In response to Re: ERROR: tablespace "archive2" is not empty  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: ERROR: tablespace "archive2" is not empty  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: ERROR: tablespace "archive2" is not empty  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
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,
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?

--
     2. That which causes joy or happiness.


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: ERROR: tablespace "archive2" is not empty
Next
From: Tom Lane
Date:
Subject: Re: ERROR: tablespace "archive2" is not empty