Re: problem/bug in drop tablespace?

From: Michael Nolan <htfoot(at)gmail(dot)com>
To: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: problem/bug in drop tablespace?
Date: 2012-05-09 18:36:57
Message-ID: CAOzAquLfA6fta8eOesnGev2iGxa+tos2fn5kbSWRGpLaPLCW4g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 5/9/12, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at> wrote:

> I cannot reproduce this on 9.1.3:

Odd, I've tried it another two times, with similar results to my initial post.

Here's what I get starting with the point where I deleted the files in
the tablespace:

mytest=# select * from mytable;
select * from mytable;
ERROR: could not open file
"pg_tblspc/289477766/PG_9.1_201105231/289477763/289477785": No such
file or directory
mytest=# \d mytable
Table "public.mytable"
Column Type Modifiers
------ ------- ---------
id integer not null
val text
Indexes:
"mytable_pkey" PRIMARY KEY, btree (id), tablespace "mytblspc"

mytest=# drop tablespace mytblspc;
drop tablespace mytblspc;
WARNING: could not open directory
"pg_tblspc/289477766/PG_9.1_201105231": No such file or directory
DROP TABLESPACE
Time: 16.460 ms
mytest=# \d mytable
Table "public.mytable"
Column Type Modifiers
------ ------- ---------
id integer not null
val text
Indexes:
"mytable_pkey" PRIMARY KEY, btree (id)

mytest=# create tablespace mytblspc location '/home/postgres/mytb';
create tablespace mytblspc location '/home/postgres/mytb';
CREATE TABLESPACE
Time: 42.396 ms
mytest=# \d mytable
Table "public.mytable"
Column Type Modifiers
------ ------- ---------
id integer not null
val text
Indexes:
"mytable_pkey" PRIMARY KEY, btree (id)

mytest=# reindex table mytable;
reindex table mytable;
REINDEX
Time: 112.981 ms

mytest=# \d mytable
Table "public.mytable"
Column Type Modifiers
------ ------- ---------
id integer not null
val text
Indexes:
"mytable_pkey" PRIMARY KEY, btree (id)

Here's what's in the mytb directory now:

[postgres(at)romaine PG_9.1_201105231]$ ls -lR
:
total 4
drwx------. 2 postgres postgres 4096 May 9 13:22 289477763

./289477763:
total 16
-rw-------. 1 postgres postgres 16384 May 9 13:22 289477790

It appears that the index has been rebuilt in the mytblspc tablespace,
though \d mytable does not show that.

I get the same results whether I rebuild the specific index as you did
or reindex the table, as I did.

I'm running on 9.1.3 built from the source code, not a distribution.
--
Mike Nolan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2012-05-09 18:44:00 Re: [COMMITTERS] pgsql: Split contrib documentation into extensions and programs
Previous Message Peter Eisentraut 2012-05-09 18:17:33 libpq URL syntax vs SQLAlchemy