Re: [PATCH] Add error hints for invalid COPY options

Kirill Reshke <reshkekirill@gmail.com>

From: Kirill Reshke <reshkekirill@gmail.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Sugamoto Shinya <shinya34892@gmail.com>, Nathan Bossart <nathandbossart@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2025-12-04T07:35:43Z
Lists: pgsql-hackers
On Thu, 4 Dec 2025 at 03:56, Masahiko Sawada <sawada.mshk@gmail.com> wrote:

> The proposed patch requires us to create one function per option. I'm
> concerned that it could cause bloating functions and be overkill just
> to save changing a separate list. I would suggest starting with
> putting a validation check for options at the top of foreach() loop.
> When adding a new COPY option in the future, it wouldn't work if we
> miss either changing the valid-options list or handling the option,
> which seems a good prevention.
>

Yep, Im +1 on that.  "bloating functions" - that's precise wording, I
did not know how to explain the same concern.


-- 
Best regards,
Kirill Reshke