Re: Proposal to Enable/Disable Index using ALTER INDEX (with patch)

Benoit Lobréau <benoit.lobreau@gmail.com>

From: Benoit Lobréau <benoit.lobreau@gmail.com>
To: Shayon Mukherjee <shayonj@gmail.com>
Cc: Sami Imseih <samimseih@gmail.com>, Michail Nikolaev <michail.nikolaev@gmail.com>, David Rowley <dgrowleyml@gmail.com>, Robert Haas <robertmhaas@gmail.com>, Peter Eisentraut <peter@eisentraut.org>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-01-24T14:20:19Z
Lists: pgsql-hackers
On Fri, Jan 24, 2025 at 11:32 AM Benoit Lobréau
<benoit.lobreau@gmail.com> wrote:
> The completion for the INVISIBLE / VISIBLE keyword is missing in psql.

I think this should to the trick ?

diff --git a/src/bin/psql/tab-complete.in.c b/src/bin/psql/tab-complete.in.c
index 81cbf10aa28..43ea8e55fd0 100644
--- a/src/bin/psql/tab-complete.in.c
+++ b/src/bin/psql/tab-complete.in.c
@@ -2393,7 +2393,8 @@ match_previous_words(int pattern_id,
        else if (Matches("ALTER", "INDEX", MatchAny))
                COMPLETE_WITH("ALTER COLUMN", "OWNER TO", "RENAME TO", "SET",
                                          "RESET", "ATTACH PARTITION",
-                                         "DEPENDS ON EXTENSION", "NO
DEPENDS ON EXTENSION");
+                                         "DEPENDS ON EXTENSION", "NO
DEPENDS ON EXTENSION",
+                                         "INVISIBLE", "VISIBLE");
        else if (Matches("ALTER", "INDEX", MatchAny, "ATTACH"))
                COMPLETE_WITH("PARTITION");
        else if (Matches("ALTER", "INDEX", MatchAny, "ATTACH", "PARTITION"))