pgsql: Fix tab-completion for COPY and \copy options.

From: Masahiko Sawada <msawada(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix tab-completion for COPY and \copy options.
Date: 2025-07-09 12:46:40
Message-ID: E1uZUC7-005Q60-3B@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix tab-completion for COPY and \copy options.

Commit c273d9d8ce4 reworked tab-completion of COPY and \copy in psql
and added support for completing options within WITH clauses. However,
the same COPY options were suggested for both COPY TO and COPY FROM
commands, even though some options are only valid for one or the
other.

This commit separates the COPY options for COPY FROM and COPY TO
commands to provide more accurate auto-completion suggestions.

Back-patch to v14 where tab-completion for COPY and \copy options
within WITH clauses was first supported.

Author: Atsushi Torikoshi <torikoshia(at)oss(dot)nttdata(dot)com>
Reviewed-by: Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
Discussion: https://postgr.es/m/079e7a2c801f252ae8d522b772790ed7@oss.nttdata.com
Backpatch-through: 14

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f5a987c0e5f6bbf0cc0420228dc57e7aae4d7e8f

Modified Files
--------------
src/bin/psql/tab-complete.in.c | 30 ++++++++++++++++++++++--------
1 file changed, 22 insertions(+), 8 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Nathan Bossart 2025-07-09 14:18:22 pgsql: Introduce pg_dsm_registry_allocations view.
Previous Message Masahiko Sawada 2025-07-09 12:46:34 pgsql: Fix tab-completion for COPY and \copy options.