Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2ad4abe

Browse files
committed
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", whichcaused ALTER FUNCTION|PROCEDURE|ROUTINE ... SET SCHEMA to completewith "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 forALTER FUNCTION/PROCEDURE/ROUTINE, but this is not directly related tothat patch. Rather, this is a long-standing bug, so back-patch to allsupported branches.Discussion:https://postgr.es/m/CALDaNm0s7GQmkLP_mx5Cvk=UzYMnjhPmXBxU8DsHEunFbC5sTg@mail.gmail.com
1 parentad38e2f commit2ad4abe

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎src/bin/psql/tab-complete.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3559,11 +3559,12 @@ psql_completion(const char *text, int start, int end)
35593559
COMPLETE_WITH("TO");
35603560

35613561
/*
3562-
* Complete ALTER DATABASE|FUNCTION||PROCEDURE|ROLE|ROUTINE|USER ... SET
3562+
* Complete ALTER DATABASE|FUNCTION|PROCEDURE|ROLE|ROUTINE|USER ... SET
35633563
* <name>
35643564
*/
35653565
elseif (HeadMatches("ALTER","DATABASE|FUNCTION|PROCEDURE|ROLE|ROUTINE|USER")&&
3566-
TailMatches("SET",MatchAny))
3566+
TailMatches("SET",MatchAny)&&
3567+
!TailMatches("SCHEMA"))
35673568
COMPLETE_WITH("FROM CURRENT","TO");
35683569

35693570
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp