Re: Uninitialized scalar variable (UNINIT) (src/backend/statistics/extended_stats.c) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Uninitialized scalar variable (UNINIT) (src/backend/statistics/extended_stats.c)
Date
Msg-id 2749674.1618207453@sss.pgh.pa.us
Whole thread Raw
In response to Re: Uninitialized scalar variable (UNINIT) (src/backend/statistics/extended_stats.c)  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Uninitialized scalar variable (UNINIT) (src/backend/statistics/extended_stats.c)  (Ranier Vilela <ranier.vf@gmail.com>)
List pgsql-hackers
Michael Paquier <michael@paquier.xyz> writes:
> On Sun, Apr 11, 2021 at 07:42:20PM -0300, Ranier Vilela wrote:
>> Em dom., 11 de abr. de 2021 às 16:25, Justin Pryzby <pryzby@telsasoft.com>
>>> I think it's cleanest to write:
>>> |HeapTupleData tmptup = {0};

> I agree that this would be cleaner.

It would be wrong, though, or at least not have the same effect.
ItemPointerSetInvalid does not set the target to all-zeroes.

(Regardless of that detail, it's generally best to accomplish
objective X in the same way that existing code does.  Deciding
that you have a better way is often wrong, and even if you
are right, you should then submit a patch to change all the
existing cases.)

            regards, tom lane



pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Re: Simplify backend terminate and wait logic in postgres_fdw test
Next
From: Michael Paquier
Date:
Subject: Problems around compute_query_id