Handle OID column inheritance correctly in ALTER TABLE ... INHERIT.
authorTom Lane <[email protected]>
Wed, 4 Jan 2017 23:00:12 +0000 (18:00 -0500)
committerTom Lane <[email protected]>
Wed, 4 Jan 2017 23:00:12 +0000 (18:00 -0500)
commit5f89a9885e118ab22689f9641237f7941d9ba8fd
tree166eacccc2679aabc3cac8435618a0b6a353450d
parente7c586e7b222b80c42de473468ce5e7e14bbca60
Handle OID column inheritance correctly in ALTER TABLE ... INHERIT.

Inheritance operations must treat the OID column, if any, much like
regular user columns.  But MergeAttributesIntoExisting() neglected to
do that, leading to weird results after a table with OIDs is associated
to a parent with OIDs via ALTER TABLE ... INHERIT.

Report and patch by Amit Langote, reviewed by Ashutosh Bapat, some
adjustments by me.  It's been broken all along, so back-patch to
all supported branches.

Discussion: https://postgr.es/m/cb13cfe7-a48c-5720-c383-bb843ab28298@lab.ntt.co.jp
src/backend/commands/tablecmds.c
src/test/regress/expected/inherit.out
src/test/regress/sql/inherit.sql