Hi Matheus,

On Wed, Jan 7, 2026 at 6:38 AM Matheus Alcantara
<[email protected]> wrote:
> +               if (fdwroutine->ImportStatistics != NULL &&
> +                       fdwroutine->StatisticsAreImportable != NULL &&
> +                       fdwroutine->StatisticsAreImportable(onerel))
> +                       import_stats = true;
> +               else
> +               {
> +                       if (fdwroutine->AnalyzeForeignTable != NULL)
> +                               ok = fdwroutine->AnalyzeForeignTable(onerel,
> +                                                                             
>                            &acquirefunc,
> +                                                                             
>                            &relpages);
> +
> +                       if (!ok)
> +                       {
> +                               ereport(WARNING,
> +                                               errmsg("skipping \"%s\" -- 
> cannot analyze this foreign table.",
> +                                                          
> RelationGetRelationName(onerel)));
> +                               relation_close(onerel, 
> ShareUpdateExclusiveLock);
> +                               return;
> +                       }
> +               }
> +
>                 if (fdwroutine->AnalyzeForeignTable != NULL)
>                         ok = fdwroutine->AnalyzeForeignTable(onerel,
>                                                                               
>                    &acquirefunc,
>                                                                               
>                    &relpages);
>
>                 if (!ok)
>                 {
>                         ereport(WARNING,
>                                         (errmsg("skipping \"%s\" --- cannot 
> analyze this foreign table",
>                                                         
> RelationGetRelationName(onerel))));
>                         relation_close(onerel, ShareUpdateExclusiveLock);
>                         return;
>                 }
>
> It seems that we have the same code within the else branch after the if/else
> check, is this correct?

No.  This should be something like the attached in [1].  (I didn't
look at the core changes in v6...)

Thanks!

Best regards,
Etsuro Fujita

[1] 
https://www.postgresql.org/message-id/CAPmGK17Dfjy_zLH1yjPqybpSueHWP7Gy_xBZXA2NpRso1qya7A%40mail.gmail.com


Reply via email to