Re: Bug: trailing comma syntax error in postgres_fdw fetch_attstats() - Mailing list pgsql-hackers

From Etsuro Fujita
Subject Re: Bug: trailing comma syntax error in postgres_fdw fetch_attstats()
Date
Msg-id CAPmGK17AJQp7_4Kr2CrqzAYds5CAvtucMjT0o5mCspz3Q+7FHQ@mail.gmail.com
Whole thread
In response to Re: Bug: trailing comma syntax error in postgres_fdw fetch_attstats()  (Etsuro Fujita <etsuro.fujita@gmail.com>)
List pgsql-hackers
On Sun, Apr 12, 2026 at 3:40 PM Etsuro Fujita <etsuro.fujita@gmail.com> wrote:
> On Sun, Apr 12, 2026 at 10:45 AM SATYANARAYANA NARLAPURAM
> <satyanarlapuram@gmail.com> wrote:
> > When importing statistics from a remote server running PostgreSQL < 17,
> > fetch_attstats() emits three NULL placeholders for the range statistics
> > columns that don't exist on older servers.  The string literal included a trailing
> > comma after the last NULL, producing invalid SQL:
> >
> >     SELECT ... NULL, NULL, NULL, FROM pg_catalog.pg_stats ...
> >
> > This fails ANALYZE or IMPORT STATISTICS on a foreign table backed
> > by a pre-v17 remote server with a syntax error.
>
> My bad, I will take care of this.

The patch looks good to me.  I will push it if there are no objections.

Best regards,
Etsuro Fujita



pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: A very quick observation of dangling pointers in Postgres pathlists
Next
From: Alexander Korotkov
Date:
Subject: Re: Fix bug with accessing to temporary tables of other sessions