pgsql: Handle OID column inheritance correctly in ALTER TABLE ... INHER

Lists: pgsql-committers
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Handle OID column inheritance correctly in ALTER TABLE ... INHER
Date: 2017-01-04 23:00:38
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-committers

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/[email protected]

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/5f89a9885e118ab22689f9641237f7941d9ba8fd

Modified Files
--------------
src/backend/commands/tablecmds.c | 33 +++++++++++++++++++++++
src/test/regress/expected/inherit.out | 49 +++++++++++++++++++++++++++++++++++
src/test/regress/sql/inherit.sql | 26 +++++++++++++++++++
3 files changed, 108 insertions(+)