From: Michael Paquier Date: Fri, 13 Oct 2023 05:19:07 +0000 (+0900) Subject: psql: Add completion support for AT [ LOCAL | TIME ZONE ] X-Git-Tag: REL_17_BETA1~1692 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d16eb83aba2e0abdc809ecffd51cc00a1beab7b8;p=thirdparty%2Fpostgresql.git psql: Add completion support for AT [ LOCAL | TIME ZONE ] AT TIME ZONE is completed with a list of supported timezones, something not needed by AT LOCAL. Author: Dagfinn Ilmari Mannsåker Reviewed-by: Jim Jones Discussion: https://postgr.es/m/87jzyzsvgv.fsf@wibble.ilmari.org --- diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index d30d719a1f8..eb4dfe80b50 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -4682,6 +4682,12 @@ psql_completion(const char *text, int start, int end) else if (TailMatches("JOIN")) COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_selectables); +/* ... AT [ LOCAL | TIME ZONE ] ... */ + else if (TailMatches("AT")) + COMPLETE_WITH("LOCAL", "TIME ZONE"); + else if (TailMatches("AT", "TIME", "ZONE")) + COMPLETE_WITH_TIMEZONE_NAME(); + /* Backslash commands */ /* TODO: \dc \dd \dl */ else if (TailMatchesCS("\\?"))