Re: Avoid possible dereference null pointer (contrib/postgres_fdw/postgres_fdw.c)

Etsuro Fujita <etsuro.fujita@gmail.com>

From: Etsuro Fujita <etsuro.fujita@gmail.com>
To: Ranier Vilela <ranier.vf@gmail.com>
Cc: Fujii Masao <masao.fujii@oss.nttdata.com>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2025-07-06T08:29:45Z
Lists: pgsql-hackers
On Fri, Jul 4, 2025 at 2:41 PM Etsuro Fujita <etsuro.fujita@gmail.com> wrote:
> On Wed, Jun 18, 2025 at 8:33 PM Ranier Vilela <ranier.vf@gmail.com> wrote:
> > Em qua., 18 de jun. de 2025 às 07:29, Etsuro Fujita <etsuro.fujita@gmail.com> escreveu:
> >> Considering fpextra cannot be NULL, I think the proposed change is
> >> something more than necessary.  IMO I think it is more appropriate to
> >> just add an assertion and a comment for that like the attached, to
> >> avoid this kind of confusion.  I think I should have done so when
> >> committing this.
> >
> > I disapprove of this change, for me it worsens readability.
> > It is better to continue without any changes, then.
> > But if there is consensus, go ahead.
>
> I'm not sure this worsens readability, but I still think it would be
> useful to avoid the same confusion in the future, so barring
> objections, I will push the patch as a master-only improvement.

Pushed after modifying the comment a little bit and fixing indentation.

Best regards,
Etsuro Fujita



Commits

  1. postgres_fdw: Add Assert to estimate_path_cost_size().