Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g3R7H-0000hX-Tg for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Sep 2018 19:29:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g3R7G-0002bI-7c for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Sep 2018 19:29:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g3R7G-0002bB-0V for pgsql-hackers@lists.postgresql.org; Fri, 21 Sep 2018 19:29:26 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g3R7D-0007i6-Jt for pgsql-hackers@postgresql.org; Fri, 21 Sep 2018 19:29:25 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w8LJTE4q011476; Fri, 21 Sep 2018 15:29:15 -0400 From: Tom Lane To: Justin Pryzby cc: Arthur Zakirov , Edmund Horner , PostgreSQL Hackers Subject: Re: adding tab completions In-reply-to: <14255.1536781029@sss.pgh.pa.us> References: <20180529092726.GA6535@zakirov.localdomain> <20180603231859.GV5164@telsasoft.com> <20180604033922.GW5164@telsasoft.com> <20180605142941.GA25460@zakirov.localdomain> <20180609234212.GT10885@telsasoft.com> <20180611203547.GA18675@artur-book.localdomain> <20180627201051.GG3554@telsasoft.com> <20180628112037.GA6937@zakirov.localdomain> <20180730004243.GE3222@telsasoft.com> <20180730082414.GA21163@zakirov.localdomain> <14255.1536781029@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Wed, 12 Sep 2018 15:37:09 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <11474.1537558154.1@sss.pgh.pa.us> Date: Fri, 21 Sep 2018 15:29:14 -0400 Message-ID: <11475.1537558154@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > The main thing that is bothering me about the remainder is its desire > to offer single-punctuation-character completions such as "(". I do > not see the point of that. You can't select a completion without > typing at least one character, so what does it accomplish to offer > those options, except clutter? Actually, after poking at it for awhile, I noticed there was a much bigger problem: tests like else if (HeadMatches2("VACUUM", "(")) would continue to fire even if the option list was complete, so that after typing say vacuum ( verbose ) you would not get offered any table names, only option names. I experimented with various fixes for that, but the only one that worked required extending word_matches() to allow a wildcard in the middle of a pattern. (Before it only allowed one at the end; but it takes just a couple more lines of code to improve that.) With that, we can do else if (HeadMatches2("VACUUM", "(*") && !HeadMatches2("VACUUM", "(*)")) and this test will not trigger if the option list is complete. I've gone ahead and pushed it with those changes. regards, tom lane