Re: [PATCH v1] psql: Do not complete HEADER MATCH for COPY TO

From: Sho Ito <i(dot)sho(dot)0628(at)gmail(dot)com>
To: Koshino Taiki <koshino(at)sraoss(dot)co(dot)jp>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
Subject: Re: [PATCH v1] psql: Do not complete HEADER MATCH for COPY TO
Date: 2026-11-04 05:14:23
Message-ID: CAG7L5+4QiSBaUdx4vOQv9n7N=LTuFEDB6qezqOfjcRaEP+69GA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 3, 2026 at 8:24 PM Koshino Taiki <koshino(at)sraoss(dot)co(dot)jp> wrote:

> The attached patch checks the COPY direction and offers "MATCH" only
> for COPY FROM. The boolean values remain available in both
> directions, and the change applies to both COPY and \copy completion.
>

Hi Taiki,

I reviewed v1 on master with assertions enabled. The build and before/after
Readline completion checks pass for both `COPY` and `\copy`: `MATCH` is
removed for `TO` and retained for `FROM`, while `true` and `false` remain
available.

Console checks confirm that both commands reject `HEADER MATCH` for `TO` [1]
and accept it for `FROM`, checking the column names.
I don't see any issues with this patch.

[1]
https://github.com/postgres/postgres/blob/126976a8ffcfa47f40d3df09243ebf4606001912/src/backend/commands/copy.c#L434-L441

Thanks,
Sho

--
=======================================
*Sho Ito (Sean)*

E-mail: i(dot)sho(dot)0628(at)gmail(dot)com
LinkedIn: *https://www.linkedin.com/in/sho-ito-0628/
<https://www.linkedin.com/in/sho-ito-0628/>*
GitHub: https://github.com/sean0628/
=======================================

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message RekGRpth 2026-11-04 05:28:20 Re: Assertion with aborted UPDATE in subtransaction
Previous Message Sho Ito 2026-11-04 04:53:09 Re: [PATCH v1] psql: Do not complete JSON format for COPY FROM