pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix psql's tab-completion of enum label values.
3+ messages / 1 participants
[nested] [flat]

* pgsql: Fix psql's tab-completion of enum label values.
@ 2022-01-16 19:59 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2022-01-16 19:59 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix psql's tab-completion of enum label values.
@ 2022-01-16 19:59 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2022-01-16 19:59 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_14_STABLE

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

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(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix psql's tab-completion of enum label values.
@ 2022-01-16 19:59 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2022-01-16 19:59 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/90a847e6dcc8fcf8d6f0eaf7b8022153d3b0f184

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(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2022-01-16 19:59 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-01-16 19:59 pgsql: Fix psql's tab-completion of enum label values. Tom Lane <tgl@sss.pgh.pa.us>
2022-01-16 19:59 pgsql: Fix psql's tab-completion of enum label values. Tom Lane <tgl@sss.pgh.pa.us>
2022-01-16 19:59 pgsql: Fix psql's tab-completion of enum label values. Tom Lane <tgl@sss.pgh.pa.us>

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