Re: [PATCH v1] psql: Do not complete JSON format for COPY FROM

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 JSON format for COPY FROM
Date: 2026-11-04 04:53:09
Message-ID: CAG7L5+7gB1g55XitDzcF0owz9igFAsU8gk3TW7syXz5jfk1z7w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

> The attached patch checks the COPY direction and offers "json" only
> for COPY TO. This 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. Console checks confirm that both `COPY`
and `\copy` reject `FORMAT JSON` for `FROM` and accept it for `TO`, matching
the backend logic [1]. The patch looks correct to me.

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

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 Sho Ito 2026-11-04 05:14:23 Re: [PATCH v1] psql: Do not complete HEADER MATCH for COPY TO
Previous Message shveta malik 2026-11-04 04:35:06 Re: Proposal: Conflict log history table for Logical Replication