Re: Format - Mailing list pgsql-general

From Ramesh T
Subject Re: Format
Date
Msg-id CAK8Zd=swBaeae+fFi_v3-VLXaGvsZwmYP=1NFDk27N7QGNiYgw@mail.gmail.com
Whole thread Raw
In response to Format  (Ramesh T <rameshparnanditech@gmail.com>)
Responses Re: Format
List pgsql-general


On Tue, Sep 29, 2015 at 6:43 PM, Ramesh T <rameshparnanditech@gmail.com> wrote:
in my mind to be beautiful ,avoid confusion to understand sql query code

like 

select abcd,cde,rfg,count(*),bcd,cde,rfg,count(*),bcd,cde,rfg,count(*) ;

if some one written, then newer or code reader understand easily
select abcd,
          cde,
          rfg,
          count(*),
...,
..,
...,
like line by line 

in postgres direct option format is not available.i want see code intended proper.
in context editor i didn't find format option only like  lower to upper..



On Mon, Sep 28, 2015 at 11:20 PM, David G. Johnston <david.g.johnston@gmail.com> wrote:
CREATE FUNCTION
CREATE VIEW

As yes, I am being mostly serious - though I have been pondering seeing what tools can do as opposed to the manual formatting I've been performing.  Even a basic linter would be helpful...

The big problem is you need to define what it means to be beautiful.  Understandable is a totally different area and that is more where views and functions come in so you can provide names to the various constructs you are using.  CTE/WITH facilitate this as well.

David J.


On Mon, Sep 28, 2015 at 8:45 AM, Ramesh T <rameshparnanditech@gmail.com> wrote:
Hi All,
          How to change sql format to look beautiful and understandable using pgadmin3 or else ther tools for postgres.

any help appreciated..



pgsql-general by date:

Previous
From: rahulraveendran
Date:
Subject: Re: pgpgout/s without swapping--what does it mean?
Next
From: Spencer Gardner
Date:
Subject: Re: pg_restore fails to restore sequences