]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix tab completion for ALTER ROLE|USER ... RESET REL_18_STABLE github/REL_18_STABLE
authorTomas Vondra <tomas.vondra@postgresql.org>
Thu, 31 Jul 2025 13:17:26 +0000 (15:17 +0200)
committerTomas Vondra <tomas.vondra@postgresql.org>
Thu, 31 Jul 2025 14:05:04 +0000 (16:05 +0200)
commit88914332eaed702afb2cdbb0b776822738d58ece
tree922f8c2e75992ac040f5b16442113fb74c685c95
parent72c437f6e464e6fd35a84d3fde7795cb13a7b453
Fix tab completion for ALTER ROLE|USER ... RESET

Commit c407d5426b87 added tab completion for ALTER ROLE|USER ... RESET,
with the intent to offer only the variables actually set on the role.
But as soon as the user started typing something, it would start to
offer all possible matching variables.

Fix this the same way ALTER DATABASE ... RESET does it, i.e. by
properly considering the prefix.

A second issue causing similar symptoms (offering variables that are not
actually set for a role) was caused by a match to another pattern. The
ALTER DATABASE ... RESET was already excluded, so do the same thing for
ROLE/USER.

Report and fix by Dagfinn Ilmari MannsÃ¥ker. Backpatch to 18, same as
c407d5426b87.

Author: Dagfinn Ilmari MannsÃ¥ker <ilmari@ilmari.org>
Reviewed-by: jian he <jian.universality@gmail.com>
Discussion: https://postgr.es/m/87qzyghw2x.fsf%40wibble.ilmari.org
Discussion: https://postgr.es/m/87tt4lumqz.fsf%40wibble.ilmari.org
Backpatch-through: 18
src/bin/psql/tab-complete.in.c