| From: | Corey Huinker <corey(dot)huinker(at)gmail(dot)com> |
|---|---|
| To: | Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com> |
| Cc: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: Several issues with postgres_fdw stats import |
| Date: | 2026-09-16 17:58:19 |
| Message-ID: | CADkLM=faBM5YRsExteo09g-+yWqWso=1dCrBLeXupy9KUe_JZw@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Wed, Sep 16, 2026 at 6:25 AM Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>
wrote:
> On Tue, Sep 15, 2026 at 8:31 PM Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>
> wrote:
> > On Tue, Sep 15, 2026 at 5:52 PM Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
> wrote:
> > > When I used v11 as the remote server, stats import via postgres_fdw
> > > resulted in the following error. I think this should be addressed as
> well.
> > >
> > > ERROR: collations are not supported by type name
> > > CONTEXT: remote SQL command: SELECT DISTINCT ON (attname COLLATE "C")
> > > attname, null_frac, avg_width, n_distinct, most_common_vals,
> > > most_common_freqs, histogram_bounds, correlation, most_common_elems,
> > > most_common_elem_freqs, elem_count_histogram, NULL, NULL, NULL FROM
> > > pg_catalog.pg_stats WHERE schemaname = 'public' AND tablename = 't'
> > > AND attname = ANY(ARRAY['i', 'j']) ORDER BY attname COLLATE "C",
> > > inherited DESC
> >
> > Reproduced here. Will fix.
>
> As the error message says, the cause of this is that the name type
> isn't collatable in v11. It was made so in v12, so I fixed this by
> just s/attname COLLATE "C"/attname::text COLLATE "C"/ to the query
> generated for v11 or older.
>
+1
>
> Also, I fixed another bug in the same function: a typo in the if-test
> to check whether the remote server is v9.2 or later. The if-test in
> Corey's original version was correct, so that's my fault when updating
> it to the current version. :palmface:
>
+1. This is a good argument for #define-ing the relevant server version
numbers going forward.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Melanie Plageman | 2026-09-16 18:32:02 | Re: WAL_LOG CREATE DATABASE strategy broken for non-standard page layouts |
| Previous Message | Bharath Rupireddy | 2026-09-16 17:48:35 | Re: Support for 8-byte TOAST values, round two |