On Sat, May 7, 2011 at 2:40 PM, Josh Kupershmidt <schmi...@gmail.com> wrote:
> Hi all,
>
> I use psql's -E mode every now and then, copy-and-pasting and further
> tweaking the SQL displayed. Most queries are displayed terminated by a
> semicolon, but quite a few aren't, making copy-and-paste just a bit
> more tedious.
>
> Attached is a patch to fix every SQL query I saw in describe.c. There
> were also a few queries with trailing newlines, and I fixed those too.

I did a quick review and test of your patch.  It didn't quite apply
cleanly due to recent non-related describe.c changes -- updated patch
attached.

First, I'll give you a thumbs up on the original inspiration for the
patch.  The output should be standardized, and I see no reason not to
append a semicolon on usability basis.  Beyond that, the changes are
mostly cosmetic and I can't see how it will break things outside of
terminating a query early by accident (I didn't see any).

What I do wonder though is if the ; appending should really be
happening in printQuery() instead of in each query -- the idea being
that formatting for external consumption should be happening in one
place.  Maybe that's over-thinking it though.

merlin

Attachment: psql_describe.v3.patch
Description: Binary data

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to