Re: Why is the index not created in the tablespace delivered in the create-index-command ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: mkl(at)webde-ag(dot)de
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Why is the index not created in the tablespace delivered in the create-index-command ?
Date: 2004-10-11 16:35:35
Message-ID: 11927.1097512535@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Michael Kleiser <mkl(at)webde-ag(dot)de> writes:
> test1=> select * from pg_indexes where tablename='foobar';
> schemaname | tablename | tablespace | indexname | indexdef
> ------------+-----------+------------+-----------+-------------------------------------------------------------------------
> public | foobar | ts_test_1 | ix_foobar | CREATE INDEX ix_foobar ON foobar USING btree (foo) TABLESPACE ts_test_2
> (1 row)

> Why is index "ix_foobar" in tablespace "ts_test_1" and not in tablespace "ts_test_2" ?
> Is it a bug ?

The index is in fact in the right tablespace, as you can verify by
checking its pg_class entry. The problem is that the pg_indexes view is
showing you the table's tablespace and not the index's. I think this is
clearly wrong, or at least not what one would find most useful.

Since we've already decided to force an initdb for beta4, there doesn't
seem to be any downside to fixing this now. I'm going to change the
view to show the index tablespace instead of the table's, and I think
also move the tablespace one column to the right --- it seems bizarre
to place it before the index name.

Thanks for the report!

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andre Maasikas 2004-10-11 17:21:21 Re: Unable to dump database/table
Previous Message Michael Kleiser 2004-10-11 16:16:59 Why is the index not created in the tablespace delivered in the create-index-command ?