Re: postgres_fdw: fix cumulative stats after imported foreign-table stats

Chao Li <li.evan.chao@gmail.com>

From: Chao Li <li.evan.chao@gmail.com>
To: Etsuro Fujita <etsuro.fujita@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Corey Huinker <corey.huinker@gmail.com>
Date: 2026-07-07T14:22:45Z
Lists: pgsql-hackers

> On Jul 7, 2026, at 02:50, Etsuro Fujita <etsuro.fujita@gmail.com> wrote:
> 
> Hi Chao,
> 
> On Mon, Jul 6, 2026 at 11:52 PM Chao Li <li.evan.chao@gmail.com> wrote:
>>> @@ -230,7 +230,8 @@ analyze_rel(Oid relid, RangeVar *relation,
>>>       if (fdwroutine->ImportForeignStatistics != NULL &&
>>>           fdwroutine->ImportForeignStatistics(onerel, va_cols, elevel))
>>>           stats_imported = true;
>>> -       else
>>> +
>>> +       if (!stats_imported)
>>> 
>>> Is this a leftover?
>> 
>> Ah, yes, that’s a leftover. Reverted that in v3.
> 
> Ok, thanks for updating the patch!  Committed and back-patched.
> 
> Best regards,
> Etsuro Fujita

Thanks for pushing.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/