Re: [PATCH] Fix column name escaping in postgres_fdw stats import
Zhenwei Shang <a934172442@gmail.com>
From: Zhenwei Shang <a934172442@gmail.com>
To: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Cc: Etsuro Fujita <etsuro.fujita@gmail.com>,
Alex Guo <guo.alex.hengchen@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>, efujita@postgresql.org
Date: 2026-05-13T07:27:24Z
Lists: pgsql-hackers
Ayush Tiwari <ayushtiwari.slg01@gmail.com> 于2026年5月12日周二 16:03写道:
> Hi Fujita-san,
>
> On Tue, 12 May 2026 at 13:06, Etsuro Fujita <etsuro.fujita@gmail.com>
> wrote:
>
>> Hi Ayush,
>>
>> On Mon, May 4, 2026 at 7:24 AM Ayush Tiwari <ayushtiwari.slg01@gmail.com>
>> wrote:
>> > Are there some edits you would like me to make on the patch?
>>
>> 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.
>
> Regards,
> 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”?
Regards,
Zhenwei Shang