Re: psql, remove include of psqlscan.c - Mailing list pgsql-hackers

From Tom Lane
Subject Re: psql, remove include of psqlscan.c
Date
Msg-id 26500.1348758468@sss.pgh.pa.us
Whole thread Raw
In response to psql, remove include of psqlscan.c  ("Karl O. Pinc" <kop@meme.com>)
Responses Re: psql, remove include of psqlscan.c  ("Karl O. Pinc" <kop@meme.com>)
List pgsql-hackers
"Karl O. Pinc" <kop@meme.com> writes:
> This patch (psql_remove_include.patch) eliminates 
> the #include of psqlscan.c at the bottom of mainloop.c.

I don't really see that this is enough of an improvement to justify
depending on a non-portable flex feature.

> I'm thinking of exposing enough of the psql parser,
> moving it to libpq, that any client-side app can
> do what libpq does; given a bunch of sql
> separated by semi-colons get the results
> of all the statements.  This should also allow
> the "statement separation" to be done on the client
> side in libpq.  Although I don't imagine that this
> will have a performance impact on the server side
> it sounds like a first step toward pushing more of
> the parsing onto the client.

Quite honestly, I don't like that idea at all either.  It's bad enough
that psql has to know so much low-level SQL syntax.  If we start
encouraging other programs to know that, we're going to be locked into
never again making any lexical-level changes.  Why exactly is "pushing
parsing onto the client" a good idea?
        regards, tom lane



pgsql-hackers by date:

Previous
From: "Karl O. Pinc"
Date:
Subject: psql, remove include of psqlscan.c
Next
From: "Karl O. Pinc"
Date:
Subject: Re: psql, remove include of psqlscan.c