| From: | Michael Paquier <michael(at)paquier(dot)xyz> |
|---|---|
| To: | Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com> |
| Cc: | Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
| Subject: | Re: Remove unused function parameters, part 2: replication |
| Date: | 2025-12-02 07:32:09 |
| Message-ID: | aS6V-YvJGltjXT-B@paquier.xyz |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Mon, Dec 01, 2025 at 06:49:25AM +0000, Bertrand Drouvot wrote:
> We can still continue to fix them when we cross them "accidentally".
>
> That said, it somehow sounds weird to wait to cross them accidentally knowing we
> have the tool to find them, so I'm still not convinced that just ignoring them
> is the right thing to do.
There are a couple of concepts that usually come in the balance here.
For example, in some cases, we may not want to remove function
arguments because it can make API definitions more consistent across
the board, aka leaner for the reader. It may be also possible that
having these function arguments lying around could help in future
backpatches, not to mention that it reduces the chances of conflicts.
Andres' arguments are on this side of the balance, as far as I
understand.
An argument that can argue in favor of a removal is if this simplifies
the stack of functions calling the function where the removal happens.
Simple example I have seen in the past: a Relation argument not used
(I think there has been at least one such example in tablecmds.c,
whatever). Removing this argument also meant that we don't require
function callers to open a Relation, removing the need to think about
the lock it would require at open. In such a case, removing an
argument has more value than what a script detects, even more if this
routine is published in a header, as it could be called by some
out-of-core extension code, or in a fork.
--
Michael
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Bertrand Drouvot | 2025-12-02 07:40:44 | Re: Remove useless pointer advance in StatsShmemInit() |
| Previous Message | Antonin Houska | 2025-12-02 07:28:00 | Re: Revisiting {CREATE INDEX, REINDEX} CONCURRENTLY improvements |