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: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: IF (NOT) EXISTS in psql-completion
Date: 2016-09-19 09:11:03
Message-ID: CAFj8pRCpoYMoUzZ74p0JvX=orUxs7o88UR0z0-Lqt6W6bS9DaQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

> Pavel
>
>
>> 2. Make keywords' case follow to input
>>
>> Allow the keywords suggested along with databse objects to
>> follow the input letter case. The core part of this patch is a
>> new function additional_kw_query(), which dynamically generates
>> additional query string with specified keywords in the desired
>> letter case. COMPLETE_WITH_* macros are modified to accept the
>> function.
>>
>>
second patch is working, but I don't think it is enough documented

what is addon in COMPLETE_WITH_QUERY(query, addon)? semantics, usage?

in 99% the addon is "" when macro
COMPLETE_WITH_SCHEMA_QUERY,COMPLETE_WITH_QUERY is used. Maybe a
introduction of new macros with nonempty addon parameter should be better.

> 3. Fix suggested keywords to follow input in tab-completion session 2
>>
>> The 2nd patch above leaves some query string containing static
>> keyword strings, which results in failure to follow input
>> letter cases. Most of them are naturally removed but role names
>> are a bother. This patch puts additional query strings for
>> several usage of roles but it might be overdone.
>>
>
this patch looks well

>
>> 4. Introduce word shift and removal feature to psql-completion
>>
>> This is the second core for the flexibility of completion code.
>> The word shift feature is the ability to omit first several
>> words in *MatchesN macros. For example this allows complete
>> create-schema's schema elements in a natural code. (Currently
>> those syntaxes that can be a schema elements are using
>> TailMatches instead of Matches, as the result HeadMatches are
>> not available there). The words removing feature is the ability
>> to (desructively) clip multiple suceessive words in the
>> previous_words list. This feature allows suceeding completion
>> code not to care about the removed words, such like UNIQUE,
>> CONCURRENTLY, VERBOSE and so on.
>>
>
I am thinking so commit's description should be inside README

Regards

Pavel

>
>> 5. Add suggestion for IF (NOT) EXISTS for some syntaxes
>>
>> This adds IF (NOT) EXISTS suggestion, as a PoC. This patch no
>> loger covers all adoptable syntaces since the places where more
>> than boilerplating is required are omitted.
>>
>> regards,
>>
>> --
>> Kyotaro Horiguchi
>> NTT Open Source Software Center
>>
>>
>>
>>
>>
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message AP 2016-09-19 09:46:11 Re: Hash Indexes
Previous Message Antonin Houska 2016-09-19 08:02:38 Possibly too stringent Assert() in b-tree code