pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: ilmari@ilmari.org
To: pgsql-hackers@postgresql.org
Subject: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE
Date: Thu, 30 Aug 2018 17:44:02 +0100
Message-ID: <d8jo9djvm7h.fsf@dalvik.ping.uio.no> (raw)

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.

PFA a patch that fixes this.

- ilmari
-- 
"A disappointingly low fraction of the human race is,
 at any given time, on fire." - Stig Sandbeck Mathisen

Attachments:

0001-Fix-tab-completion-for-ALTER-TABLE-SET-TABLESPACE.patch (text/x-diff, 1.1K) download From a72d9dc1f38606a0bca8ff29b561915b8cbe9d5c 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=20TABLE=20?= =?UTF-8?q?=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.c index 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

view thread (22+ messages)  latest in thread

Message-ID: <d8jo9djvm7h.fsf@dalvik.ping.uio.no>
Permalink:  ../d8jo9djvm7h.fsf@dalvik.ping.uio.no/
Also on:    postgresql.org/message-id/d8jo9djvm7h.fsf@dalvik.ping.uio.no

 ·  · 

reply

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: <d8jo9djvm7h.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