pgsql: Fix tab completion of ALTER FUNCTION/PROCEDURE/ROUTINE ... SET S

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix tab completion of ALTER FUNCTION/PROCEDURE/ROUTINE ... SET S
Date: 2023-01-06 11:21:31
Message-ID: E1pDkmx-002JV4-8z@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix tab completion of ALTER FUNCTION/PROCEDURE/ROUTINE ... SET SCHEMA.

The ALTER DATABASE|FUNCTION|PROCEDURE|ROLE|ROUTINE|USER ... SET <name>
case in psql tab completion failed to exclude <name> = "SCHEMA", which
caused ALTER FUNCTION|PROCEDURE|ROUTINE ... SET SCHEMA to complete
with "FROM CURRENT" and "TO", which won't work.

Fix that, so that those cases now complete with the list of schemas,
like other ALTER ... SET SCHEMA commands.

Noticed while testing the recent patch to improve tab completion for
ALTER FUNCTION/PROCEDURE/ROUTINE, but this is not directly related to
that patch. Rather, this is a long-standing bug, so back-patch to all
supported branches.

Discussion: https://postgr.es/m/CALDaNm0s7GQmkLP_mx5Cvk=UzYMnjhPmXBxU8DsHEunFbC5sTg@mail.gmail.com

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2daf4664ce5402e4bd5bda24bf52716137336ad2

Modified Files
--------------
src/bin/psql/tab-complete.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2023-01-06 13:37:21 pgsql: Fix typo
Previous Message Dean Rasheed 2023-01-06 09:59:51 pgsql: Improve tab completion for ALTER FUNCTION/PROCEDURE/ROUTINE.