On 5/9/12, Albe Laurenz <laurenz.a...@wien.gv.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@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

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to