From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Cc: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
Subject: | WIP: pg_pretty_query |
Date: | 2012-08-07 14:14:34 |
Message-ID: | CAFj8pRCzqdx3MbHdexOAYgxSS3FYOOwfZ8Vx=Aw74fQb+PUA0A@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hello
last year we are spoke about reusing pretty print view code for some queries.
Here is patch:
this patch is really short - it is nice. But - it works only with
known database objects (probably we would it) and it doesn't format
subqueries well
postgres=# select pg_pretty_query('select x.*, z.* from foo, foo x, x
z where x.a = 10 and x.a = 30 and EXISTS(SELECT * FROM foo WHERE a =
z.a)', true, false);
pg_pretty_query
----------------------------------------------------------
SELECT x.a, z.a +
FROM foo, foo x, x z +
WHERE x.a = 10 AND x.a = 30 AND (EXISTS ( SELECT foo.a+
FROM foo +
WHERE foo.a = z.a))
(1 row)
Regards
Pavel
Attachment | Content-Type | Size |
---|---|---|
pg_pretty_query.patch | application/octet-stream | 2.5 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Thom Brown | 2012-08-07 14:36:59 | Re: WIP: pg_pretty_query |
Previous Message | Bruce Momjian | 2012-08-07 14:01:40 | Re: -Wformat-zero-length |