Re: IF (NOT) EXISTS in psql-completion

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: IF (NOT) EXISTS in psql-completion
Date: 2016-03-17 20:02:59
Message-ID: CAFj8pRDO97DxLHnj8FHSXVRMoaZWotWPK8b1O3izjgaODPZU1w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

2016-03-16 5:01 GMT+01:00 Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp
>:

> Hello,
>
> # It seems that I have been forgotten in the recepient list..
>
> At Tue, 15 Mar 2016 22:09:59 -0400, Peter Eisentraut <peter_e(at)gmx(dot)net>
> wrote in <56E8C077(dot)2000903(at)gmx(dot)net>
> > On 2/5/16 3:09 AM, Kyotaro HORIGUCHI wrote:
> > > I considered how to make tab-completion robust for syntactical
> > > noises, in other words, optional words in syntax. Typically "IF
> > > (NOT) EXISTS", UNIQUE and TEMPORARY are words that don't affect
> > > further completion.
> >
> > To repeat the question I raised in the previous commit fest about tab
> > completion: Why do you want tab completion for IF NOT EXISTS? When you
> > tab complete, the completion mechanism will show you whether the item in
> > question exists. What is the use case?
>
> Ah, I think I understand you question. It's not about IF EXISTS,
> but only IF NOT EXSTS. It is needed when repeated execution of
> the same SQL statement will be done using command line
> history. Such stocks of commands in history is often
> convenient. And sometimes I rely on psql-completion to write a
> SQL script. The completions for such words seemingly useless on
> instant-execution will be handy to do that.
>
> Another thing I want to do by this patch is that we can get
> completion even after such optional words. I have been annoyed
> many times by this. Some of them, such as UNIQUE, TEMPORARY and
> CONCURRENTLY are treated but they just doubles the matching
> condition expressions.
>

I am looking this patch. It looks well, but this feature doesn't respect
upper or lower chars. It enforce upper chars. This is not consistent with
any other autocomplete.

Regards

Pavel

>
> regards,
>
> --
> Kyotaro Horiguchi
> NTT Open Source Software Center
>
>
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-03-17 20:11:00 pgsql: Improve memory management for external sorts.
Previous Message Joshua D. Drake 2016-03-17 19:31:19 Make primnodes.h gender neutral