| From: | Corey Huinker <corey(dot)huinker(at)gmail(dot)com> |
|---|---|
| To: | Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com> |
| Cc: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com> |
| Subject: | Re: use of SPI by postgresImportForeignStatistics |
| Date: | 2026-08-12 15:00:26 |
| Message-ID: | CADkLM=fPHG-i3VUePVWY_SwbXtEq+z3R7exHPPKOXn-MAfF=1g@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Wed, Aug 12, 2026 at 7:00 AM Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>
wrote:
> On Wed, Aug 12, 2026 at 2:31 AM Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
> wrote:
> >> There is one thing I'd like to change for v19: the name of the option
> >> for this feature. We named it restore_stats because it used the
> >> pg_restore_*() functions [1], but it doesn't use them anymore; it uses
> >> import_*_statistics() instead, so I think we should rename it to
> >> import_stats if not too late. I think it also matches the names of
> >> functions added to postgres_fdw.c like import_fetched_statistics().
> >> What do you think?
> >
> > I think it's worth a quick patch...
>
> The patch looks good to me. I will push/backpatch it if there are no
> objections from others.
>
> Thanks for the patch!
>
> Best regards,
> Etsuro Fujita
>
With that out of the way, I'm re-attaching the v2-0010 and v2-0012 patches
from my earlier set to show what the NullableDatum array endgame looks,
though those patchsets assume that some of the enumerations are externally
visible, and that would no longer be the case. The prefixes on the the
enums help the coder to avoid using the wrong one. -- OR -- we probably
could do an index offset like we do with the Anum_relname_attname - 1 tuple
indexes, which then requires that we pack all of the actual-stat column
values at the end, which is easy. Overall I don't think either of those
patterns is better or worse a solution than explicitly named parameters, so
it comes down to preference, and I'll rework the patchset to match those
preferences.
| Attachment | Content-Type | Size |
|---|---|---|
| v2-0010-Add-relation_statistics_update-refactor-update_re.patch | text/x-patch | 12.5 KB |
| v2-0012-Add-attribute_statistics_update-refactor-update_a.patch | text/x-patch | 23.3 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Daniel Gustafsson | 2026-08-12 15:14:17 | Re: LibreSSL and OpenSSL separation in libpq to support 1.1.1 deprecation |
| Previous Message | Álvaro Herrera | 2026-08-12 14:54:58 | Re: Avoid recalculating pgprocno in ProcArrayAdd() |