This should be a slighly more complete patch for commands/command.c
AlterTableAddConstraint. The major changes from the last patch
are that it should hopefully check for references to temp tables
(not in the shadow case, but at defination time) from permanent tables in
foreign keys and refuse them and that it doesn't allow the table(s)
being constrained to be views (because those cases don't currently
work).
Stephan Szabo
sszabo(at)bigpanda(dot)com