Tab completion for TABLESAMPLE

Lists: pgsql-hackers
From: Petr Jelinek <petr(at)2ndquadrant(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Tab completion for TABLESAMPLE
Date: 2015-06-14 10:40:55
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

looks like I omitted psql tab completion from the TABLESAMPLE patch. The
attached patch adds it.

--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
psql-complete-tablesample.patch text/x-patch 1.1 KB

From: Brendan Jurd <direvus(at)gmail(dot)com>
To: Petr Jelinek <petr(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Tab completion for TABLESAMPLE
Date: 2015-06-19 07:08:50
Message-ID: CADxJZo2VXKpMVDaUHzVheRuOEBHK1PrWYZjCWmjAhEWdCx9=dQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

On Sun, 14 Jun 2015 at 20:44 Petr Jelinek <petr(at)2ndquadrant(dot)com> wrote:

> looks like I omitted psql tab completion from the TABLESAMPLE patch. The
> attached patch adds it.
>

Hi Petr,

I'm doing an initial review of this patch.

It applies and compiles cleanly. Code style is consistent with its
surroundings.

With the patch applied, psql correctly offers a list of existing
tablesample methods for completion whenever the previous word is
'TABLESAMPLE'. I did notice that the syntax of the TABLESAMPLE clause
requires brackets after the method name, but the tab completion does not
complete the opening bracket. Whereas, say, ALTER FUNCTION does. I think
it would be convenient and user-friendly to complete the opening bracket --
it would make it perfectly clear that an argument is required for the
syntax to be valid.

Otherwise, no issues with the patch.

Cheers,
BJ


From: Petr Jelinek <petr(at)2ndquadrant(dot)com>
To: Brendan Jurd <direvus(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Tab completion for TABLESAMPLE
Date: 2015-06-19 11:04:59
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

On 2015-06-19 09:08, Brendan Jurd wrote:
> On Sun, 14 Jun 2015 at 20:44 Petr Jelinek <petr(at)2ndquadrant(dot)com
> <mailto:petr(at)2ndquadrant(dot)com>> wrote:
>
> looks like I omitted psql tab completion from the TABLESAMPLE patch. The
> attached patch adds it.
>
>
> Hi Petr,
>
> I'm doing an initial review of this patch.

Thanks

>
> With the patch applied, psql correctly offers a list of existing
> tablesample methods for completion whenever the previous word is
> 'TABLESAMPLE'. I did notice that the syntax of the TABLESAMPLE clause
> requires brackets after the method name, but the tab completion does not
> complete the opening bracket. Whereas, say, ALTER FUNCTION does. I
> think it would be convenient and user-friendly to complete the opening
> bracket -- it would make it perfectly clear that an argument is required
> for the syntax to be valid.
>

Agreed, here is updated version which does that.

--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
psql-complete-tablesample-v2.patch text/x-patch 1.2 KB

From: Brendan Jurd <direvus(at)gmail(dot)com>
To: Petr Jelinek <petr(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Tab completion for TABLESAMPLE
Date: 2015-06-19 20:01:52
Message-ID: CADxJZo0CN_Yno8s9sc0CE6RZDYUabmK8gG=6tOP233vwDGwcxA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, 19 Jun 2015 at 21:05 Petr Jelinek <petr(at)2ndquadrant(dot)com> wrote:

> On 2015-06-19 09:08, Brendan Jurd wrote:
> > I
> > think it would be convenient and user-friendly to complete the opening
> > bracket -- it would make it perfectly clear that an argument is required
> > for the syntax to be valid.
> >
>
> Agreed, here is updated version which does that.
>

Thanks Petr, I have tested your v2 and it works well. This is ready for
committer.

Cheers,
BJ


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Brendan Jurd <direvus(at)gmail(dot)com>
Cc: Petr Jelinek <petr(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Tab completion for TABLESAMPLE
Date: 2015-06-22 18:16:03
Message-ID: CA+Tgmob=u4yVfDnBR6bGj=vbT2y1PGu0WNDsvx-nCN=Ddm9QJA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Jun 19, 2015 at 4:01 PM, Brendan Jurd <direvus(at)gmail(dot)com> wrote:
> On Fri, 19 Jun 2015 at 21:05 Petr Jelinek <petr(at)2ndquadrant(dot)com> wrote:
>>
>> On 2015-06-19 09:08, Brendan Jurd wrote:
>> > I
>> > think it would be convenient and user-friendly to complete the opening
>> > bracket -- it would make it perfectly clear that an argument is required
>> > for the syntax to be valid.
>> >
>>
>> Agreed, here is updated version which does that.
>
>
> Thanks Petr, I have tested your v2 and it works well. This is ready for
> committer.

Committed, thanks.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company