Обсуждение: file_fdw: Support multi-line HEADER option.

Поиск
Список
Период
Сортировка

file_fdw: Support multi-line HEADER option.

От
Shinya Kato
Дата:
Hi hackers,
(CC: Fujii-san, committer of bc2f348e8)

Commit bc2f348e8[0] introduced multi-line HEADER support for COPY.
However, file_fdw does not yet support it, so I have implemented it in
the attached patch.

Since foreign table options in CREATE/ALTER FOREIGN TABLE are
specified as single-quoted strings, I updated defGetCopyHeaderOption()
to handle string values as well.

Thoughts?

[0] https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=bc2f348e87c02de63647dbe290d64ff088880dbe

--
Best regards,
Shinya Kato
NTT OSS Center

Вложения

Re: file_fdw: Support multi-line HEADER option.

От
Fujii Masao
Дата:
On Fri, Jan 9, 2026 at 5:15 PM Shinya Kato <shinya11.kato@gmail.com> wrote:
>
> Hi hackers,
> (CC: Fujii-san, committer of bc2f348e8)
>
> Commit bc2f348e8[0] introduced multi-line HEADER support for COPY.
> However, file_fdw does not yet support it, so I have implemented it in
> the attached patch.
>
> Since foreign table options in CREATE/ALTER FOREIGN TABLE are
> specified as single-quoted strings, I updated defGetCopyHeaderOption()
> to handle string values as well.
>
> Thoughts?

+1

Could you add this patch to the next Commitfest? It would be better to
commit it in v19 so that multi-line header support is delivered for
both COPY and file_fdw at the same time.

Regards,

--
Fujii Masao



Re: file_fdw: Support multi-line HEADER option.

От
"songjinzhou"
Дата:
Hi Shinya Kato

I tested the patch and have no functional questions. I have a small question: Is it necessary to add "(also as a
string,to support file_fdw options)" to the final `ereport` error message in `defCheckCopyHeaderString`? Like in one of
yourcomments below.
 

Thank you.

songjinzhou
tsinghualucky912@foxmail.com


Re: file_fdw: Support multi-line HEADER option.

От
Shinya Kato
Дата:
On Fri, Jan 9, 2026 at 7:22 PM Fujii Masao <masao.fujii@gmail.com> wrote:
> > Thoughts?
>
> +1

Thank you for the review!

> Could you add this patch to the next Commitfest? It would be better to
> commit it in v19 so that multi-line header support is delivered for
> both COPY and file_fdw at the same time.

Yeah, this feature is targeted for v19. I've added it to the next Commitfest.
https://commitfest.postgresql.org/patch/6383/

--
Best regards,
Shinya Kato
NTT OSS Center



Re: file_fdw: Support multi-line HEADER option.

От
Japin Li
Дата:
On Fri, 09 Jan 2026 at 21:57, Shinya Kato <shinya11.kato@gmail.com> wrote:
> On Fri, Jan 9, 2026 at 7:22 PM Fujii Masao <masao.fujii@gmail.com> wrote:
>> > Thoughts?
>>
>> +1
>
> Thank you for the review!
>
>> Could you add this patch to the next Commitfest? It would be better to
>> commit it in v19 so that multi-line header support is delivered for
>> both COPY and file_fdw at the same time.
>
> Yeah, this feature is targeted for v19. I've added it to the next Commitfest.
> https://commitfest.postgresql.org/patch/6383/
>

A minor nitpick:

+  or a numeric line count for <literal>HEADER</literal>) to enable the desired
+  behavior.

s/numeric/non-negative integer/

More precise: excludes negative values & clarifies it's an integer.

--
Regards,
Japin Li
ChengDu WenWu Information Technology Co., Ltd.