Bruce,
Problem is the use of heap_drop_with_catalog().
* heap_drop_with_catalog - removes all record of named
relation from catalogs** 1) open relation, check for existence, etc.* 2) remove
inheritanceinformation* 3) remove indexes* 4) remove pg_class tuple*
5) remove pg_attribute tuples and related descriptions* 6) remove pg_description tuples*
7) remove pg_type tuples* 8) RemoveConstraints ()* 9) unlink relation
Only these things are destroyed. relchecks, for example, stays consistent
and works correctly.
Gavin