Re: Remove PointerIsValid()

2025-09-24 Thread Peter Eisentraut
On 17.09.25 18:26, Jacob Champion wrote: On Tue, Sep 16, 2025 at 10:21 PM Peter Eisentraut wrote: I think there is agreement that the PointerIsValid() macro is pretty useless. This patch proposes to remove it. There have been a few recent mini-discussions in other threads that appear to supp

Re: Remove PointerIsValid()

2025-09-17 Thread Michael Paquier
On Wed, Sep 17, 2025 at 11:21:10AM -0500, Nathan Bossart wrote: > On Wed, Sep 17, 2025 at 10:15:10AM -0400, Peter Geoghegan wrote: >>> There were the usual concerns about code churn and backpatching and so >>> on, but I think in the end the change is not that big and it's in pretty >>> boring posit

Re: Remove PointerIsValid()

2025-09-17 Thread David Rowley
On Thu, 18 Sept 2025 at 03:55, Robert Haas wrote: > I agree that we should prefer foo != NULL, but if the surrounding code > in a particular location just tests if (foo), then it may be better in > that case to go that route. +1. I generally do (var != NULL) for pointers rather than (var). I thin

Re: Remove PointerIsValid()

2025-09-17 Thread Jacob Champion
On Tue, Sep 16, 2025 at 10:21 PM Peter Eisentraut wrote: > > I think there is agreement that the PointerIsValid() macro is pretty > useless. This patch proposes to remove it. There have been a few > recent mini-discussions in other threads that appear to support this. [0][1] Patch LGTM, and I l

Re: Remove PointerIsValid()

2025-09-17 Thread Nathan Bossart
On Wed, Sep 17, 2025 at 10:15:10AM -0400, Peter Geoghegan wrote: > On Wed, Sep 17, 2025 at 1:21 AM Peter Eisentraut wrote: >> I think there is agreement that the PointerIsValid() macro is pretty >> useless. This patch proposes to remove it. There have been a few >> recent mini-discussions in oth

Re: Remove PointerIsValid()

2025-09-17 Thread Robert Haas
On Wed, Sep 17, 2025 at 4:12 AM Chao Li wrote: > Given the context of replacing PointerIsValid(x), I think if (foo != NULL) is > slightly better than if (x), because that explicitly shows the intent of > checking pointers, while if (x) works for both pointers and integers. I agree that we shoul

Re: Remove PointerIsValid()

2025-09-17 Thread Peter Geoghegan
On Wed, Sep 17, 2025 at 1:21 AM Peter Eisentraut wrote: > I think there is agreement that the PointerIsValid() macro is pretty > useless. This patch proposes to remove it. There have been a few > recent mini-discussions in other threads that appear to support this. [0][1] I'm also in favor of r

Re: Remove PointerIsValid()

2025-09-17 Thread Chao Li
> On Sep 17, 2025, at 13:21, Peter Eisentraut wrote: > > I think there is agreement that the PointerIsValid() macro is pretty useless. > This patch proposes to remove it. There have been a few recent > mini-discussions in other threads that appear to support this. [0][1] > > There were the

Remove PointerIsValid()

2025-09-16 Thread Peter Eisentraut
[email protected] [1]: https://www.postgresql.org/message-id/[email protected] af26264d850a40e5c9c4e73fea81189ca9f6bb6a Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 17 Sep 2025 07:11:05 +0200 Subject: [PATCH] R