psql: Improve tab completion for COPY command.
authorFujii Masao <fujii@postgresql.org>
Mon, 30 Jun 2025 09:36:24 +0000 (18:36 +0900)
committerFujii Masao <fujii@postgresql.org>
Mon, 30 Jun 2025 09:36:24 +0000 (18:36 +0900)
commita4c10de9291291bce3dd2b81bd8b5f0b98649244
tree3cb252948a19c9c5ee777e107cc0c96ff3ae855e
parent960135114629bc89da0dd1d839541098c7e6401a
psql: Improve tab completion for COPY command.

Previously, tab completion for COPY only suggested plain tables
and partitioned tables, even though materialized views are also
valid for COPY TO (since commit 534874fac0b), and foreign tables
are valid for COPY FROM.

This commit enhances tab completion for COPY to also include
materialized views and foreign tables.

Views with INSTEAD OF INSERT triggers are supported with
COPY FROM but rarely used, so plain views are intentionally
excluded from completion.

Author: jian he <jian.universality@gmail.com>
Co-authored-by: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Reviewed-by: David G. Johnston <david.g.johnston@gmail.com>
Discussion: http://postgr.es/m/CACJufxFxnSkikp+GormAGHcMTX1YH2HRXW1+3dJM9w7yY9hdsg@mail.gmail.com
src/bin/psql/tab-complete.in.c