tablecmds.c/MergeAttributes() cleanup
Peter Eisentraut <peter@eisentraut.org>
Attachments
- 0001-Remove-obsolete-comment-about-OID-support.patch (text/plain) patch 0001
- 0002-Remove-ancient-special-case-code-for-adding-oid-colu.patch (text/plain) patch 0002
- 0003-Remove-ancient-special-case-code-for-dropping-oid-co.patch (text/plain) patch 0003
- 0004-Make-more-use-of-makeColumnDef.patch (text/plain) patch 0004
- 0005-Clean-up-MergeAttributesIntoExisting.patch (text/plain) patch 0005
- 0006-Clean-up-MergeCheckConstraint.patch (text/plain) patch 0006
- 0007-MergeAttributes-and-related-variable-renaming.patch (text/plain) patch 0007
- 0008-Improve-some-catalog-documentation.patch (text/plain) patch 0008
- 0009-Remove-useless-if-condition.patch (text/plain) patch 0009
- 0010-Remove-useless-if-condition.patch (text/plain) patch 0010
- 0011-Refactor-ATExecAddColumn-to-use-BuildDescForRelation.patch (text/plain) patch 0011
- 0012-Push-attidentity-and-attgenerated-handling-into-Buil.patch (text/plain) patch 0012
- 0013-Move-BuildDescForRelation-from-tupdesc.c-to-tablecmd.patch (text/plain) patch 0013
- 0014-Push-attcompression-and-attstorage-handling-into-Bui.patch (text/plain) patch 0014
- 0015-Add-TupleDescGetDefault.patch (text/plain) patch 0015
- 0016-MergeAttributes-convert-pg_attribute-back-to-ColumnD.patch (text/plain) patch 0016
- 0017-Add-some-const-decorations.patch (text/plain) patch 0017
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.
Commits
-
Fix segmentation fault in MergeInheritedAttribute()
- 8f0a97dfffc5 17.0 landed
-
Improve compression and storage support with inheritance
- 0413a556990b 17.0 cited
-
Split some code out from MergeAttributes()
- f7cf9494bad3 17.0 landed
-
MergeAttributes code deduplication
- 64444ce071f6 17.0 landed
-
Add a const decoration
- 924d046dcf55 17.0 landed
-
MergeAttributes: convert pg_attribute back to ColumnDef before comparing
- 4d969b2f85e1 17.0 landed
-
Refactor ATExecAddColumn() to use BuildDescForRelation()
- a1604237a6ff 17.0 landed
-
Move BuildDescForRelation() from tupdesc.c to tablecmds.c
- 04e485273b56 17.0 landed
-
Push attcompression and attstorage handling into BuildDescForRelation()
- 180e3394a704 17.0 landed
-
Push attidentity and attgenerated handling into BuildDescForRelation()
- 6d341407a6e3 17.0 landed
-
Add TupleDescGetDefault()
- ebf76f2753a9 17.0 landed
-
MergeAttributes() and related variable renaming
- b0ae29512c21 17.0 landed
-
Clean up MergeCheckConstraint()
- 369202bf4be6 17.0 landed
-
Clean up MergeAttributesIntoExisting()
- eddad679d2ab 17.0 landed
-
Remove useless if condition
- 6844d3275ac6 17.0 landed
- 689c66a84bb7 17.0 landed
-
Make more use of makeColumnDef()
- 1fa9241bdd0e 17.0 landed
-
Add some const decorations
- 2b088c8e4a2c 17.0 landed
-
Remove ancient special case code for dropping oid columns
- 7ef2912519fd 17.0 landed
-
Remove ancient special case code for adding oid columns
- 5eaa0e92ee2f 17.0 landed
-
Remove obsolete comment about OID support
- adf333b4edb2 17.0 landed