Re: COMMENT ON, psql and access methods

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Teodor Sigaev <teodor(at)sigaev(dot)ru>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: COMMENT ON, psql and access methods
Date: 2016-06-06 22:35:01
Message-ID: 20160606223501.GA433569@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Paquier wrote:
> On Thu, Jun 2, 2016 at 3:42 PM, Michael Paquier
> <michael(dot)paquier(at)gmail(dot)com> wrote:
> > On Thu, Jun 2, 2016 at 1:00 PM, Michael Paquier
> > <michael(dot)paquier(at)gmail(dot)com> wrote:
> >> I have added an open item for 9.6 regarding this patch, that would be
> >> good to complete this work in this release for consistency with the
> >> other objects.
> >
> > Doh. I forgot to update psql --help.
>
> And Query_for_list_of_access_methods was defined more or less twice,
> the one of my patch having an error...

In looking at the DROP ACCESS METHOD completion I noticed that the
words_after_create gadget is a bit buggy: for things with more than one
word in the thing name (such as MATERIALIZED VIEW, USER MAPPING FOR,
EVENT TRIGGER among others) the "query/squery"-based completion isn't
triggered, because the loop at the end of psql_completion only considers
a single word (using strcmp against prev_wd), which obviously doesn't
match the multiple-word specifier in the struct. Some things such as
EVENT TRIGGER and MATERIALIZED VIEW have specialized code that does the
actual work; the latter specifies a query in words_after_create, but
it's dead code. As a probably separate but related bug, CREATE USER
MAPPING FOR stops working after you tab-complete the USER in it.
Lastly, there is an entry for CONFIGURATION which also doesn't work: if
you enter "DROP <tab>" it doesn't complete CONFIGURATION, but if you
enter "DROP CONFIGURATION <tab>" then it shows a list of text search
configurations, which is not a valid command.

To conclude, so far as I can tell, your patch (for DROP AM completion)
is fine, but the existing code has some minor flags which we could just
as well ignore for now, but could be improved in the future.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Korbin Hoffman 2016-06-06 23:57:10 Re: hstore: add hstore_length function
Previous Message Michael Paquier 2016-06-06 21:55:21 Re: Problem with dumping bloom extension