Re: Unused parameters & co in code
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2019-01-31T06:47:59Z
Lists: pgsql-hackers
Attachments
- 0001-Simplify-SendAuthRequest.patch (text/x-diff) patch 0001
- 0002-Simplify-_bt_relbuf.patch (text/x-diff) patch 0002
- 0003-Simplify-gin-code.patch (text/x-diff) patch 0003
- 0004-Simplify-some-code-in-clause-parsing.patch (text/x-diff) patch 0004
- 0005-Simplify-some-pg_rewind-code.patch (text/x-diff) patch 0005
- 0006-Simplify-a-bit-code-of-tablecmds.c.patch (text/x-diff) patch 0006
On Wed, Jan 30, 2019 at 08:14:05AM -0300, Alvaro Herrera wrote: > On 2019-Jan-30, Michael Paquier wrote: >> ReindexPartitionedIndex => parentIdx > > I'd not change this one, as we will surely want to do something useful > eventually. Not that it matters, but it'd be useless churn. A lot of these things assume that the unused arguments may be useful in the future. >> _bt_relbuf => rel (Quite some cleanup here for the btree code) > > If this is a worthwhile cleanup, let's see a patch. This cleanup is disappointing, so it can be discarded. I looked at all the references I have spotted yesterday, and most of them are not really worth the trouble, still there are some which could be cleaned up. Attached is a set of patches which do some cleanup here and there, I don't propose all of them for commit, some of them are attached just for reference: - 0001 cleans up port in SendAuthRequest. This one is disappointing, so I am fine to discard it. - 0002 works on _bt_relbuf, whose callers don't actually benefit from the cleanup as the relation worked on is always used for different reasons, so it can be discarded. - 0003 works on the code of GIN, which simplifies at least the code, so it could be applied. This removes more than changed. - 0004 also cleans some code for clause parsing, with a negative line output. - 0005 is for pg_rewind, which is some stuff I introduced, so I'd like to clean up my mess and the change is recent :) - 0006 is for tablecmds.c, and something I would like to apply because it reduces some confusion with some recursion arguments which are not needed for constraint handling and inheritance. Most of the complains come from lockmode not being used but all the AtPrep and AtExec routines are rather symmetric so I am not bothering about that. -- Michael
Commits
-
Simplify some code in pg_rewind when syncing target directory
- 6e52209eb1f8 12.0 landed
-
Don't force-assign transaction id when exporting a snapshot.
- 6c2003f8a1bb 10.0 cited