Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZpNXm-0003Ta-8N for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Oct 2015 21:37:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZpNXl-0004dF-Q7 for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Oct 2015 21:37:05 +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.84) (envelope-from ) id 1ZpNXk-0004cG-H4 for pgsql-hackers@postgresql.org; Thu, 22 Oct 2015 21:37:04 +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.84) (envelope-from ) id 1ZpNXi-0001rW-0E for pgsql-hackers@postgresql.org; Thu, 22 Oct 2015 21:37:04 +0000 Received: from pro.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t9MLarGB015940; Thu, 22 Oct 2015 17:36:54 -0400 From: Tom Lane To: Robert Haas cc: Thomas Munro , Jeff Janes , Alvaro Herrera , Pg Hackers Subject: Re: Making tab-complete.c easier to maintain In-reply-to: References: <17081.1441374043@sss.pgh.pa.us> <20150907135605.GP2912@alvherre.pgsql> Comments: In-reply-to Robert Haas message dated "Thu, 22 Oct 2015 17:29:51 -0400" Date: Thu, 22 Oct 2015 14:36:53 -0700 Message-ID: <51382.1445549813@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Robert Haas writes: > On Wed, Oct 21, 2015 at 8:54 PM, Thomas Munro > wrote: >> (Apologies for sending so many versions. tab-complete.c keeps moving >> and I want to keep a version that applies on top of master out there, >> for anyone interested in looking at this. As long as no one objects >> and there is interest in the patch, I'll keep doing that.) > I don't want to rain on the parade since other people seem to like > this, but I'm sort of unimpressed by this. Yes, it removes >1000 > lines of code, and that's not nothing. But it's all mechanical code, > so, not to be dismissive, but who really cares? Is it really worth > replacing the existing notation that we all know with a new one that > we have to learn? I'm not violently opposed if someone else wants to > commit this, but I'm unexcited about it. What I would like is to find a way to auto-generate basically this entire file from gram.y. That would imply going over to something at least somewhat parser-based, instead of the current way that is more or less totally ad-hoc. That would be a very good thing though, because the current way gives wrong answers not-infrequently, even discounting cases that it's simply not been taught about. I have no very good idea how to do that, though. Bison does have a notion of which symbols are possible as the next symbol at any given parse point, but it doesn't really make that accessible. There's a lack of cooperation on the readline side too: we'd need to be able to see the whole query buffer not just the current line. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers