pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Fetter <david@fetter.org>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Jeff Janes <jeff.janes@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Making tab-complete.c easier to maintain
Date: Thu, 22 Oct 2015 16:05:06 -0700
Message-ID: <53412.1445555106@sss.pgh.pa.us> (raw)
In-Reply-To: <20151022221425.GB22539@fetter.org>
References: <17081.1441374043@sss.pgh.pa.us>
	<CAEepm=0QKjnVVq9ueBXP5yntNFwtFZhFzLPEOpCA-PPoh0NieQ@mail.gmail.com>
	<20150907135605.GP2912@alvherre.pgsql>
	<CAEepm=3q9oBsd65F3AMTKw9-Rs+E+SDV3HpGV5yLj7ySetj7Yw@mail.gmail.com>
	<CAEepm=1=Hdt9TCM3BRiVE6NCnXHyDDki+YVPhfZ02_=niU=8cA@mail.gmail.com>
	<CAMkU=1yt=Ed7+K4sUisdUkt-wDhGnxdkDqs_43uJvhJYFA56gQ@mail.gmail.com>
	<CAEepm=1ns0rbo+xun_j6_PwDT6zmEPuNggy=Vaie-3peF2C44Q@mail.gmail.com>
	<CAEepm=2X08QRoJD3Bu4em-w=c=Q7SCCHM404jK-ercR4H1xtkw@mail.gmail.com>
	<CA+TgmoYow9qMFJ8hJipmd7K9=_xeUtAVVarQJGY401_nTnopeQ@mail.gmail.com>
	<51382.1445549813@sss.pgh.pa.us>
	<20151022221425.GB22539@fetter.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

David Fetter <david@fetter.org> writes:
> On Thu, Oct 22, 2015 at 02:36:53PM -0700, Tom Lane wrote:
>> 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.

> This may be on point:

> http://stackoverflow.com/questions/161495/is-there-a-nice-way-of-handling-multi-line-input-with-gnu-...

> I suspect we might have to stop pretending to support alternatives to
> libreadline if we went that direction, not that that would necessarily
> be a bad idea.

Given the license issues around GNU readline, requiring it seems like
probably a non-starter.

It strikes me though that maybe we don't need readline's cooperation.
I think it's already true that the previous lines of the query buffer
are stashed somewhere that psql knows about, so in principle we could
sew them together with the current line.  That might be a project worth
tackling on its own, since we could make the existing code smarter about
multiline queries, whether or not we ever get to a grammar-based solution.

			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



view thread (86+ messages)  latest in thread

Message-ID: <53412.1445555106@sss.pgh.pa.us>
Permalink:  ../53412.1445555106@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/53412.1445555106@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, david@fetter.org, robertmhaas@gmail.com, thomas.munro@enterprisedb.com, jeff.janes@gmail.com, alvherre@2ndquadrant.com
  Subject: Re: Making tab-complete.c easier to maintain
  In-Reply-To: <53412.1445555106@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox