From: Fujii Masao Date: Fri, 17 Apr 2026 05:31:05 +0000 (+0900) Subject: psql: Fix incorrect tab completion after CREATE PUBLICATION ... EXCEPT (...) X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=4e0e1f3b2704e04768a4bccb7102450d74730a50;p=thirdparty%2Fpostgresql.git psql: Fix incorrect tab completion after CREATE PUBLICATION ... EXCEPT (...) Previously, tab completion after EXCEPT (...) always suggested FROM SERVER. This was correct for IMPORT FOREIGN SCHEMA ... EXCEPT (...), but became incorrect once commit fd366065e06 added CREATE PUBLICATION ... EXCEPT (...). This commit updates tab completion so FROM SERVER is no longer suggested after CREATE PUBLICATION ... EXCEPT (...), while preserving the existing behavior for IMPORT FOREIGN SCHEMA ... EXCEPT (...). Author: Vignesh C Reviewed-by: Shveta Malik Reviewed-by: Fujii Masao Discussion: https://postgr.es/m/CALDaNm1-Fx6Msw6zcRuSjgQdw6asdTyp2DwP-4TCKGYAT+ndsA@mail.gmail.com --- diff --git a/src/bin/psql/tab-complete.in.c b/src/bin/psql/tab-complete.in.c index 9990f818942..db65d130fcb 100644 --- a/src/bin/psql/tab-complete.in.c +++ b/src/bin/psql/tab-complete.in.c @@ -4900,7 +4900,7 @@ match_previous_words(int pattern_id, else if (Matches("IMPORT", "FOREIGN", "SCHEMA", MatchAny)) COMPLETE_WITH("EXCEPT (", "FROM SERVER", "LIMIT TO ("); else if (TailMatches("LIMIT", "TO", "(*)") || - TailMatches("EXCEPT", "(*)")) + Matches("IMPORT", "FOREIGN", "SCHEMA", MatchAny, "EXCEPT", "(*)")) COMPLETE_WITH("FROM SERVER"); else if (TailMatches("FROM", "SERVER", MatchAny)) COMPLETE_WITH("INTO");