Re: Function scan FDW pushdown - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: Function scan FDW pushdown
Date
Msg-id CAPpHfduE7MivD8SzpoDFrOahpqtc-UGpEpZ9BXmUGjL2XbFbcQ@mail.gmail.com
Whole thread
In response to Re: Function scan FDW pushdown  (Alexander Pyhalov <a.pyhalov@postgrespro.ru>)
List pgsql-hackers
On Sat, Aug 29, 2026 at 10:21 PM Marina Polyakova
<m.polyakova@postgrespro.ru> wrote:
> I got this warning with gcc-13 ([1], [2]) and CFLAGS=-Og (both -O0 and
> -O1 work fine). Both gcc-12 [3] and gcc-14 [4] work fine with
> CFLAGS=-Og. IMO this compiler warning is strange because the attached
> patch with a simple code reordering fixes it.
>
> [1] https://github.com/gcc-mirror/gcc/releases/tag/releases%2Fgcc-13.3.0
> [2] https://github.com/gcc-mirror/gcc/releases/tag/releases%2Fgcc-13.4.0
> [3] Ubuntu 12.3.0-1ubuntu1~22.04.3 12.3.0
> [4] https://github.com/gcc-mirror/gcc/releases/tag/releases%2Fgcc-14.4.0
>
> On 2026-08-28 16:18, Karina Litskevich wrote:
> > Hi!
> >
> > Here is another compilation warning that seems to be caused by this
> > patch.
> >
> > postgres_fdw.c: In function ‘foreign_join_ok’:
> > postgres_fdw.c:7135:46: error: ‘fpinfo_i’ may be used
> > uninitialized [-Werror=maybe-uninitialized]
> >  7135 |         if (fpinfo_o->local_conds || fpinfo_i->local_conds)
> >       |                                      ~~~~~~~~^~~~~~~~~~~~~
> > postgres_fdw.c:7044:28: note: ‘fpinfo_i’ was declared here
> >  7044 |         PgFdwRelationInfo *fpinfo_i;
> >       |                            ^~~~~~~~

Yes, compiler may fail to trace invariants of
inner_is_function/outer_is_function flags usage. I suggest to remove
them altogether.  See the attached patch.  I think this code also
becomes a bit more readable.

------
Regards,
Alexander Korotkov
Supabase

Attachment

pgsql-hackers by date:

Previous
From: Zsolt Parragi
Date:
Subject: Re: Routed ON CONFLICT inserts broken by partition-local deferrable unique constraints in 19 and master
Next
From: Alexander Korotkov
Date:
Subject: Re: Two issues leading to discrepancies in FSM data on the standby server