From: ilmari@ilmari.org
To: pgsql-hackers@postgresql.org
Subject: Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE
Date: Thu, 30 Aug 2018 17:54:23 +0100
Message-ID: <d8jk1o7vlq8.fsf@dalvik.ping.uio.no> (raw)
In-Reply-To: <d8jo9djvm7h.fsf@dalvik.ping.uio.no>
References: <d8jo9djvm7h.fsf@dalvik.ping.uio.no>
ilmari@ilmari.org (Dagfinn Ilmari Mannsåker) writes:
> Hi hackers,
>
> I just noticed that psql's tab completion for ALTER TABLE … SET
> TABLESPACE was treating it as any other configuration parameter and
> completing with FROM DEFAULT or TO after it, instead of a list of
> tablespaces.
And just after hitting send, I noticed I'd typed ALTER TABLE instead of
ALTER DATABASE, including in the commit message :(
Fixed patch attached.
- ilmari
--
"I use RMS as a guide in the same way that a boat captain would use
a lighthouse. It's good to know where it is, but you generally
don't want to find yourself in the same spot." - Tollef Fog Heen
Attachments:0001-Fix-tab-completion-for-ALTER-DATABASE-SET-TABLESPACE.patch (text/x-diff, 1.1K) download
From e5ff67c3284dd456fe80ed8a8927e12665d68fea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@ilmari.org>
Date: Thu, 30 Aug 2018 17:36:16 +0100
Subject: [PATCH] =?UTF-8?q?Fix=20tab=20completion=20for=20ALTER=20DATABASE?=
=?UTF-8?q?=20=E2=80=A6=20SET=20TABLESPACE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
It was being treated as any other configuration parameter.
---
src/bin/psql/tab-complete.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.cindex bb696f8ee9..f107ffb027 100644--- a/src/bin/psql/tab-complete.c+++ b/src/bin/psql/tab-complete.c@@ -1783,6 +1783,10 @@ psql_completion(const char *text, int start, int end)
"IS_TEMPLATE", "ALLOW_CONNECTIONS",
"CONNECTION LIMIT");
+ /* ALTER DATABASE <name> SET TABLESPACE */+ else if (Matches5("ALTER", "DATABASE", MatchAny, "SET", "TABLESPACE"))+ COMPLETE_WITH_QUERY(Query_for_list_of_tablespaces);+
/* ALTER EVENT TRIGGER */
else if (Matches3("ALTER", "EVENT", "TRIGGER"))
COMPLETE_WITH_QUERY(Query_for_list_of_event_triggers);
--
2.18.0
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: ilmari@ilmari.org
Subject: Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE
In-Reply-To: <d8jk1o7vlq8.fsf@dalvik.ping.uio.no>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox