Re: [COMMITTERS] pgsql: Improve pretty printing of viewdefs.

Lists: pgsql-committerspgsql-hackers
From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve pretty printing of viewdefs.
Date: 2012-02-19 16:50:37
Message-ID: E1Rz9y9-0003Cb-Bm@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Improve pretty printing of viewdefs.

Some line feeds are added to target lists and from lists to make
them more readable. By default they wrap at 80 columns if possible,
but the wrap column is also selectable - if 0 it wraps after every
item.

Andrew Dunstan, reviewed by Hitoshi Harada.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/2f582f76b1945929ff07116cd4639747ce9bb8a1

Modified Files
--------------
doc/src/sgml/func.sgml | 12 ++-
src/backend/utils/adt/ruleutils.c | 137 +++++++++++++++++++++++++++-
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_proc.h | 2 +
src/include/utils/builtins.h | 1 +
src/test/regress/expected/polymorphism.out | 4 +-
src/test/regress/expected/rules.out | 33 +++++++
src/test/regress/expected/with.out | 25 +++---
src/test/regress/sql/rules.sql | 6 +
9 files changed, 204 insertions(+), 18 deletions(-)


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Improve pretty printing of viewdefs.
Date: 2012-02-19 17:04:53
Message-ID: CAFj8pRDHh4giwho1xKCFvg+WaTBDajm_+CgrLigXaaWDmfbF0Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Hello

nice

should be this functionality used for query too?

some like

pg_pretty_query('SELECT ... ', 80)

when we have this functionality.

Regards

Pavel

2012/2/19 Andrew Dunstan <andrew(at)dunslane(dot)net>:
> Improve pretty printing of viewdefs.
>
> Some line feeds are added to target lists and from lists to make
> them more readable. By default they wrap at 80 columns if possible,
> but the wrap column is also selectable - if 0 it wraps after every
> item.
>
> Andrew Dunstan, reviewed by Hitoshi Harada.
>
> Branch
> ------
> master
>
> Details
> -------
> http://git.postgresql.org/pg/commitdiff/2f582f76b1945929ff07116cd4639747ce9bb8a1
>
> Modified Files
> --------------
> doc/src/sgml/func.sgml                     |   12 ++-
> src/backend/utils/adt/ruleutils.c          |  137 +++++++++++++++++++++++++++-
> src/include/catalog/catversion.h           |    2 +-
> src/include/catalog/pg_proc.h              |    2 +
> src/include/utils/builtins.h               |    1 +
> src/test/regress/expected/polymorphism.out |    4 +-
> src/test/regress/expected/rules.out        |   33 +++++++
> src/test/regress/expected/with.out         |   25 +++---
> src/test/regress/sql/rules.sql             |    6 +
> 9 files changed, 204 insertions(+), 18 deletions(-)
>
>
> --
> Sent via pgsql-committers mailing list (pgsql-committers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-committers


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Improve pretty printing of viewdefs.
Date: 2012-02-19 21:18:07
Message-ID: 4F41670F.1000206@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers


[redirecting to -hackers]

On 02/19/2012 12:04 PM, Pavel Stehule wrote:
> Hello
>
> nice
>
> should be this functionality used for query too?
>
> some like
>
> pg_pretty_query('SELECT ... ', 80)
>
> when we have this functionality.
>
>

It would probably be possible to leverage some of this for that, but
it's certainly not part of the present piece of work. All the logic is
there in get_query_def() and friends. There would need to be a wrapper
that called the parser to get a query object from the input string and
then called get_query_def() to get back the reformatted output, and
there are probably any number of wrinkles I haven't thought of.

cheers

andrew


From: Andrew Dunstan <adunstan(at)postgresql(dot)org>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Improve pretty printing of viewdefs.
Date: 2012-02-19 21:19:16
Message-ID: 4F416754.5070605@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

On 02/19/2012 04:18 PM, Andrew Dunstan wrote:
>
> [redirecting to -hackers]

Arghh, this time redirecting ...
>
> On 02/19/2012 12:04 PM, Pavel Stehule wrote:
>> Hello
>>
>> nice
>>
>> should be this functionality used for query too?
>>
>> some like
>>
>> pg_pretty_query('SELECT ... ', 80)
>>
>> when we have this functionality.
>>
>>
>
> It would probably be possible to leverage some of this for that, but
> it's certainly not part of the present piece of work. All the logic is
> there in get_query_def() and friends. There would need to be a wrapper
> that called the parser to get a query object from the input string and
> then called get_query_def() to get back the reformatted output, and
> there are probably any number of wrinkles I haven't thought of.
>
> cheers
>
> andrew