vikas(dot)dogra(at)tabs(dot)toshiba(dot)com (Vikas) writes:
> We backup and restore Postgres databases using pg_dump and pg_restore.
> Though pg_restore process does not throw any exception but After using
> it for restoring we are not able to insert or update records in the
> tables having Primary Keys. The message we get is "The primary key is
> not a btree."
Do you mean "Index <foo> is not a btree"? That's the closest match
I can find in the sources.
This implies that the version code stored in the first page of an index
is wrong. If you see this without having gone through spectacular
failures (system crashes) then I'd have to bet that there is something
very flaky about your hardware. Run some hardware diagnostics ---
memtest86 and badblocks are often recommended. (Note that badblocks has
been known to miss disk failures unless run in its "destructive" test
mode...)
regards, tom lane