Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZpNjt-0003v7-TW for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Oct 2015 21:49:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZpNjt-0002TY-2w for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Oct 2015 21:49:37 +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.84) (envelope-from ) id 1ZpNjs-0002TO-Fi for pgsql-hackers@postgresql.org; Thu, 22 Oct 2015 21:49:36 +0000 Received: from out.smtp-auth.no-ip.com ([8.23.224.60]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZpNjo-0000OB-M6 for pgsql-hackers@postgresql.org; Thu, 22 Oct 2015 21:49:35 +0000 X-No-IP: alvh.no-ip.org@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from alvin.alvh.no-ip.org (unknown [200.104.52.149]) (Authenticated sender: alvh.no-ip.org@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id D8647401246; Thu, 22 Oct 2015 14:49:30 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id E6005C78; Thu, 22 Oct 2015 18:49:28 -0300 (CLT) Date: Thu, 22 Oct 2015 18:49:28 -0300 From: Alvaro Herrera To: Tom Lane Cc: Robert Haas , Thomas Munro , Jeff Janes , Pg Hackers Subject: Re: Making tab-complete.c easier to maintain Message-ID: <20151022214928.GS3391@alvherre.pgsql> References: <17081.1441374043@sss.pgh.pa.us> <20150907135605.GP2912@alvherre.pgsql> <51382.1445549813@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <51382.1445549813@sss.pgh.pa.us> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -2.6 (--) 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 Tom Lane wrote: > 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 did discuss exactly this topic with Thomas a month ago or so in private email, and our conclusion was that it would be a really neat project but a lot more effort than this patch. And after skimming over the patch back then, I think this is well worth the reduced maintenance effort. > 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. At the current pace, a project like this might take years to turn into a real patch. My own vote is for applying this for the time being. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers