Re: [PATCH] Fix column name escaping in postgres_fdw stats import

From: Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>
To: Zhenwei Shang <a934172442(at)gmail(dot)com>
Cc: Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com>, Alex Guo <guo(dot)alex(dot)hengchen(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, efujita(at)postgresql(dot)org
Subject: Re: [PATCH] Fix column name escaping in postgres_fdw stats import
Date: 2026-05-13 11:22:16
Message-ID: CAPmGK14RwQJOwaxDC0Jkd1nTGCb4SzKjQ7-Z5b6gPJpxtz6p8A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Wed, May 13, 2026 at 4:27 PM Zhenwei Shang <a934172442(at)gmail(dot)com> wrote:
> Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com> 于2026年5月12日周二 16:03写道:
>> On Tue, 12 May 2026 at 13:06, Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com> wrote:
>>> One thing I noticed is the test case you added; it only tests
>>> departing column names with single quotes, but it's better to also
>>> test that with backslashes, to confirm the patch addresses the issue
>>> in [1] as well. So I updated the patch as such. New version
>>> attached. Other than that the patch looks good to me, so I'll push it
>>> if no objections from you (or anyone else).

>> Thanks for the updated version, and for folding in the backslash case
>> from [1].
>>
>> I confirmed that the patch applies cleanly on master and that
>> make -C contrib/postgres_fdw check passes, including the new
>> dtest_ftable case. The merged test seems a strict improvement.
>>
>> No objections from me.

Cool! Thanks for double-checking, Ayush!

> The patch overall looks solid to me. A tiny suggestion, while here, would it make sense to also add comma and brace column names to the test, as they are classic array-literal hazards, like “col,comma” and “col{brace”?

Those cases are handled correctly even without the patch, so sorry, I
don't feel the need to extend the test further.

Anyway, thanks for reviewing, Zhenwei!

Best regards,
Etsuro Fujita

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2026-05-13 11:40:57 Re: Import Statistics in postgres_fdw before resorting to sampling.
Previous Message Ayush Tiwari 2026-05-13 10:53:09 Re: [PATCH] Rebuild CHECK constraints after generated column SET EXPRESSION