> When I run this simple scenario:
>
> create table foo (i int);
> -- everything is fine
> select * from pg_class where relname = 'foo'
> -- no problem
> select * from pg_class where oid = {oid_num}
> -- no problem
> create index foo_x on foo using btree(i);
> -- Looks ok but it is not
> select * from pg_class where relname = 'foo'
> -- no rows found
> select * from pg_class where oid = {oid_num}
> -- no rows found
> -- The table and the index in pg_class cannot be found via ether index.
> -- They look like single part indexes too.
> select * from pg_class
> -- shows foo and foo_x along w/ everything else.
> -- I can use the UPDATE statement to rewrite the foo and foo_x rows into
> pg_class
> -- and all is well again.
> -- INSERTing into foo does not seem to be a problem.
> -- ALTER table has similar negative effects on the system tables, but I
> have yet to sort them all out.
This does help. Can you check UpdateRelationRelation(), which is called
from create_index, and which calls CatalogIndexInsert()? Seems like the
problem must be in that area.
Looks like Tatsuo Ishii is on this already, as he has suggested some
good fixes to heap_addheader(), which is called from
UpdateRelationRelation().
Again, I am sorry to have broken this stuff so badly.
--
Bruce Momjian | 830 Blythe Avenue
maillist@candle.pha.pa.us | Drexel Hill, Pennsylvania 19026
+ If your life is a hard drive, | (610) 353-9879(w)
+ Christ can be your backup. | (610) 853-3000(h)