Re: psql tab completion bug for ALL IN TABLESPACE

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql tab completion bug for ALL IN TABLESPACE
Date: 2015-12-14 11:44:20
Message-ID: CAB7nPqQAhH8VKYBH25MQZWu3rhagH+0zj1vtdHzxoixvu4Jsmg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Dec 14, 2015 at 8:36 PM, Andres Freund <andres(at)anarazel(dot)de> wrote:
> On 2015-12-14 12:18:27 +0100, Andres Freund wrote:
>> On 2015-12-12 21:04:31 +0900, Michael Paquier wrote:
>> > Hi all,
>> >
>> > I just bumped into the following thing while looking again at Thomas'
>> > patch for psql tab completion:
>> > --- a/src/bin/psql/tab-complete.c
>> > +++ b/src/bin/psql/tab-complete.c
>> > @@ -1040,7 +1040,7 @@ psql_completion(const char *text, int start, int end)
>> > pg_strcasecmp(prev5_wd, "IN") == 0 &&
>> > pg_strcasecmp(prev4_wd, "TABLESPACE") == 0 &&
>> > pg_strcasecmp(prev2_wd, "OWNED") == 0 &&
>> > - pg_strcasecmp(prev4_wd, "BY") == 0)
>> > + pg_strcasecmp(prev_wd, "BY") == 0)
>> > {
>> > COMPLETE_WITH_QUERY(Query_for_list_of_roles);
>> > This should be backpatched, attached is the needed patch.
>>
>> Hm, this seems to need slightly more expansive surgery.
>>
>> Trivially the comments for ALL IN TABLESPACE seem broken/badly copy pasted:
>> /* ALTER TABLE,INDEX,MATERIALIZED VIEW xxx ALL IN TABLESPACE xxx */
>> the first xxx doesnt make sense.
>>
>> Secondly the OWNED BY completion then breaks the SET TABLESPACE
>> completion. That's maybe not an outright bug, but seems odd nonetheless.
>>
>> Fujii, Stephen?
>
> I'm off to do something else for a while, but attached is where I
> stopped at.

Just a bit more and you can get the whole set...
--
Michael

Attachment Content-Type Size
psql-tab-alltbspace.patch binary/octet-stream 2.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2015-12-14 11:47:22 Re: Patch: ResourceOwner optimization for tables with many partitions
Previous Message Bill Moran 2015-12-14 11:44:00 Re: Proposal: custom compression methods