Fix an ancient oversight in change_varattnos_of_a_node: it neglected to update
authorTom Lane <[email protected]>
Fri, 9 May 2008 22:38:05 +0000 (22:38 +0000)
committerTom Lane <[email protected]>
Fri, 9 May 2008 22:38:05 +0000 (22:38 +0000)
commit609bc78b0989d6bc92e4119c8eccaa586572bc94
tree60cd1489157b9d51d34f7382b50c34d975be8482
parent502a0bcd7f80efa82837d492adce5022b0f52a5f
Fix an ancient oversight in change_varattnos_of_a_node: it neglected to update
varoattno along with varattno.  This resulted in having Vars that were not
seen as equal(), causing inheritance of the "same" constraint from different
parent relations to fail.  An example is

create table pp1 (f1 int check (f1>0));
create table cc1 (f2 text, f3 int) inherits (pp1);
create table cc2(f4 float) inherits(pp1,cc1);

Backpatch as far as 7.4.  (The test case still fails in 7.4, for reasons
that I don't feel like investigating at the moment.)

This is a backpatch commit only.  The fix will be applied in HEAD as part
of the upcoming pg_constraint patch.
src/backend/commands/tablecmds.c