tablecmds.c/MergeAttributes() cleanup

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: tablecmds.c/MergeAttributes() cleanup
Date: 2023-06-28 16:30:14
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

The MergeAttributes() and related code in and around tablecmds.c is huge
and ancient, with many things bolted on over time, and difficult to deal
with. I took some time to make careful incremental updates and
refactorings to make the code easier to follow, more compact, and more
modern in appearance. I also found several pieces of obsolete code
along the way. This resulted in the attached long patch series. Each
patch tries to make a single change and can be considered incrementally.
At the end, the code is shorter, better factored, and I hope easier to
understand. There shouldn't be any change in behavior.

Attachment Content-Type Size
0001-Remove-obsolete-comment-about-OID-support.patch text/plain 1.1 KB
0002-Remove-ancient-special-case-code-for-adding-oid-colu.patch text/plain 2.0 KB
0003-Remove-ancient-special-case-code-for-dropping-oid-co.patch text/plain 5.1 KB
0004-Make-more-use-of-makeColumnDef.patch text/plain 5.7 KB
0005-Clean-up-MergeAttributesIntoExisting.patch text/plain 11.5 KB
0006-Clean-up-MergeCheckConstraint.patch text/plain 3.9 KB
0007-MergeAttributes-and-related-variable-renaming.patch text/plain 15.1 KB
0008-Improve-some-catalog-documentation.patch text/plain 2.1 KB
0009-Remove-useless-if-condition.patch text/plain 1.1 KB
0010-Remove-useless-if-condition.patch text/plain 1.2 KB
0011-Refactor-ATExecAddColumn-to-use-BuildDescForRelation.patch text/plain 7.5 KB
0012-Push-attidentity-and-attgenerated-handling-into-Buil.patch text/plain 2.1 KB
0013-Move-BuildDescForRelation-from-tupdesc.c-to-tablecmd.patch text/plain 8.7 KB
0014-Push-attcompression-and-attstorage-handling-into-Bui.patch text/plain 2.5 KB
0015-Add-TupleDescGetDefault.patch text/plain 5.0 KB
0016-MergeAttributes-convert-pg_attribute-back-to-ColumnD.patch text/plain 15.9 KB
0017-Add-some-const-decorations.patch text/plain 1.3 KB


Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2023-06-28 16:31:01 Re: Assistance Needed: Issue with pg_upgrade and --link option
Previous Message Tom Lane 2023-06-28 16:27:59 Re: eqjoinsel_semi still sucks ...