Re: Unused parameters & co in code

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Unused parameters & co in code
Date: 2019-01-31 06:47:59
Message-ID: 20190131064759.GA13429@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
0001-Simplify-SendAuthRequest.patch text/x-diff 5.3 KB
0002-Simplify-_bt_relbuf.patch text/x-diff 16.7 KB
0003-Simplify-gin-code.patch text/x-diff 4.0 KB
0004-Simplify-some-code-in-clause-parsing.patch text/x-diff 1.8 KB
0005-Simplify-some-pg_rewind-code.patch text/x-diff 1.4 KB
0006-Simplify-a-bit-code-of-tablecmds.c.patch text/x-diff 7.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2019-01-31 06:49:24 Re: Adding a TAP test checking data consistency on standby with minRecoveryPoint
Previous Message Kyotaro HORIGUCHI 2019-01-31 06:31:53 Re: Index Skip Scan