Re: WIP: pg_pretty_query

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: Re: WIP: pg_pretty_query
Date: 2012-08-07 15:53:45
Message-ID: 20120807155345.GM29773@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Aug 7, 2012 at 04:14:34PM +0200, Pavel Stehule wrote:
> 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)

I can see this as very useful for people reporting badly-formatted
queries to our email lists. Great!

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2012-08-07 16:30:42 Re: WIP: pg_pretty_query
Previous Message Jeff MacDonald 2012-08-07 15:16:06 Re: [PATCH] Docs: Make notes on sequences and rollback more obvious