| From: | Chao Li <li(dot)evan(dot)chao(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 07:08:56 |
| Message-ID: | C076CC07-ED59-4591-8441-D77C4CF38DD1@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
> On Nov 4, 2026, at 09:22, Koshino Taiki <koshino(at)sraoss(dot)co(dot)jp> wrote:
>
> Hi,
>
> I noticed that psql's tab completion suggests the JSON format for both
> directions of COPY.
>
> For example:
>
> COPY t1 FROM STDIN WITH (FORMAT <TAB><TAB>
> binary csv json text
>
> However, the documentation says that the JSON format is allowed only
> for COPY TO. If a user selects the suggested "json" candidate, the
> command fails:
>
> COPY t1 FROM STDIN WITH (FORMAT JSON);
> ERROR: COPY FORMAT JSON is not supported for COPY FROM
>
> I think it is misleading for tab completion to suggest syntax that is
> explicitly unsupported by the documentation and rejected by the
> server.
>
> The attached patch checks the COPY direction and offers "json" only
> for COPY TO. This applies to both COPY and \copy completion.
>
> There is already a separate discussion proposing support for COPY FROM
> with FORMAT json [1]. If that support is committed, the completion can
> of course be extended at the same time. However, in the current tree
> COPY FROM does not support JSON, so I think tab completion should
> reflect the currently implemented and documented behavior.
>
> [1]
> https://www.postgresql.org/message-id/CAEG8a3%2BwxMXGLcnrDzSF0qTDzH%2BK7_x0FWNAcu-H_j8gKiwFVw%40mail.gmail.com
>
> Regards,
>
>
> Taiki Koshino<koshino(at)sraoss(dot)co(dot)jp>
> SRA OSS K.K.
> TEL: 03-5979-2701 FAX: 03-5979-2702
> URL: https://www.sraoss.co.jp/
>
> <v1-0001-psql-Do-not-complete-JSON-format-for-COPY-FROM.patch>
Same as the other your patch, the fix looks good, however, there is an earlier patch [1] already.
[1] https://postgr.es/m/CAF1DzPXjeGHhpgKzEWmpuoxdZWwErN79yRodOkwRYAt7Bdn2BA@mail.gmail.com
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Amit Langote | 2026-11-04 07:17:13 | Re: [PATCH] Fix segmentation fault caused by reentrancy in RI_Fkey_cascade_del (ri_triggers.c) |
| Previous Message | Peter Smith | 2026-11-04 07:08:25 | Re: Proposal: Conflict log history table for Logical Replication |