Peter Eisentraut <peter_e@gmx.net> writes:
> Or maybe look at it this way:
> create table test1 (a int4);
> create table test2 (b int4) inherits (test1);
> ^ col #1 ^ col #2
> alter table test1* add column c int4;
> ^ col #3
> Everything has its order and it's not like the inheritance as such is
> broken.
Yes, a whole bunch of stuff is broken after this happens. Go back and
consult the archives --- or maybe Chris Bitmead will fill you in; he's
got plenty of scars to show for this set of problems. (All I recall
offhand is that pg_dump and reload can fail to generate a working
database.) The bottom line is that it would be a lot nicer if column c
had the same column position in both the parent table and the child
table(s).
I suggest you be very cautious about messing with ALTER TABLE until you
understand why inheritance makes it such a headache ;-)
regards, tom lane