From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix psql's tab-completion of enum label values.
Date: Sun, 16 Jan 2022 19:59:34 +0000
Message-ID: <E1n9Bgc-0004ZK-6P@gemulon.postgresql.org> (raw)
Fix psql's tab-completion of enum label values.
Since enum labels have to be single-quoted, this part of the
tab completion machinery got side-swiped by commit cd69ec66c.
A side-effect of that commit is that (at least with some versions
of Readline) the text string passed for completion will omit the
leading quote mark of the enum label literal. Libedit still acts
the same as before, though, so adapt COMPLETE_WITH_ENUM_VALUE so
that it can cope with either convention.
Also, when we fail to find any valid completion, set
rl_completion_suppress_quote = 1. Otherwise readline will
go ahead and append a closing quote, which is unwanted.
Per report from Peter Eisentraut. Back-patch to v13 where
cd69ec66c came in.
Discussion: https://postgr.es/m/8ca82d89-ec3d-8b28-8291-500efaf23b25@enterprisedb.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/fe75517443b7c38f5251d007d06321655ce6c0b6
Modified Files
--------------
src/bin/psql/t/010_tab_completion.pl | 13 ++++++++-
src/bin/psql/tab-complete.c | 51 +++++++++++++++++++++++++++++++-----
2 files changed, 57 insertions(+), 7 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Fix psql's tab-completion of enum label values.
In-Reply-To: <E1n9Bgc-0004ZK-6P@gemulon.postgresql.org>
References: <E1n9Bgc-0004ZK-6P@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox