Fix tab completion of ALTER FUNCTION/PROCEDURE/ROUTINE ... SET SCHEMA.
authorDean Rasheed <[email protected]>
Fri, 6 Jan 2023 11:11:51 +0000 (11:11 +0000)
committerDean Rasheed <[email protected]>
Fri, 6 Jan 2023 11:11:51 +0000 (11:11 +0000)
commit274185d116f415700849ad25acb94f79830ed9c1
tree19ba55b3a886fd87483a53b4ec201ea49334cfc1
parent1a5ff7be26966cec33d5593b89f8c5f94d29d036
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
src/bin/psql/tab-complete.c