Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f4GBl-0006Be-F1 for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Apr 2018 01:29:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f4GBk-0001OI-Cj for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Apr 2018 01:29:12 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f4GBj-0001O9-8G for pgsql-hackers@lists.postgresql.org; Fri, 06 Apr 2018 01:29:12 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f4GBf-00061w-Um for pgsql-hackers@lists.postgresql.org; Fri, 06 Apr 2018 01:29:10 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 0E8F620BA1; Thu, 5 Apr 2018 21:29:07 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Thu, 05 Apr 2018 21:29:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=ctNhyd lja7uBp1PbI/NxPlagohCOIBod9+eV7ef1jvY=; b=LQUkb6CGCBWejfiCQMhtTb SxjJzIoJ08b8EazQD//xI+ooGRFWwggQhftfkwprfKPovV8mV7Bw5co3CZs1IE1o bgF3MGLoY312mQx8TczbWMm3D5d44y10MMYFayD+fsQShSY4KTXc43eGwX564z2h mU8Qllbz/J346RRFQO/0p+3eCfxngS6VnDlv7QzHPdIaQT+GGKMQoEHH/0Dx5yty Cne4UkdjDr+mK4RGmx2sEjlJP1zlJY2t0gwAVNiznqfJxciH8vzTUZSWHAx9w5kO eXTaLu6NzxsAxp+hcjNZISb7K8lRTIY1nipbNF75yluSEdsRZR2wwkH6auz4FV6Q == X-ME-Sender: Received: from april.local (c-73-13-66-39.hsd1.pa.comcast.net [73.13.66.39]) by mail.messagingengine.com (Postfix) with ESMTPA id A2264E508D; Thu, 5 Apr 2018 21:29:06 -0400 (EDT) Subject: Re: PATCH: psql tab completion for SELECT To: Edmund Horner , Tom Lane References: <882D6617-FA16-4C56-8FE0-884BCBBE5A4C@anarazel.de> <2738.1516234038@sss.pgh.pa.us> <3a919958-e508-3b66-686f-44a7937fb6e7@2ndquadrant.com> <24314.1520190408@sss.pgh.pa.us> <10992.1520260903@sss.pgh.pa.us> Cc: Vik Fearing , Andres Freund , pgsql-hackers@lists.postgresql.org From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: Date: Thu, 5 Apr 2018 21:29:06 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 3/21/18 02:51, Edmund Horner wrote: > I still think the number of completions on an empty string is a bit > too big, but I don't know what to omit. There are around 1700 > completions on the empty "postgres" database in my testing, and we > show the first 1000 (arbitrarily limited, as the generated SQL has > LIMIT 1000 but no ORDER BY). > > Should we just leave it as is? > > Whether we improve the filtering or not, I'm optimistic the feature > will be committed in this CF or the next. I looked at this a bit now. I think it still needs some work. Some of the queries for older versions contain syntax errors that causes them not to work. For example, in 80100: "'internal'::regtype != ALL ([.proargtypes) " The query definition structures are missing a comma between selcondition and viscondition. This causes all the following fields to be misassigned. I'm not quite sure how it actually works at all some of the time. There might be another bug that offsets this one. I'd like to see a short comment what is different between each of the version queries. You had a list earlier in the thread. The selection of which functions to show can be further refined. I don't think the contents of pg_amproc and pg_cast should be excluded. Some of those functions are useful. Similarly for pg_operator.oprcode. Things like oprrest and oprjoin will already be excluded because they have "internal" arguments. Similarly for some columns in pg_aggregate. There are also additional pseudo-types that should be excluded. See pg_type.typtype = 'p', except some of those should not be excluded. Needs more thought. Considering these issues, I think it would be appropriate to move this patch to the next commitfest. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services