If you use pgAdmin3 for example, it will format the definition in the database for you. This will exclude stored procedures, which are stored as-is. The formatter isn't too good however... There are better products on the market that will do the formatting significantly better. This one was nice: http://psti.equinoxbase.com/cgi-bin/handler.pl - Joris >-----Original Message----- >From: Aaron Bingham [mailto:bingham@xxxxxxxxxxxxxxxxxxxx] >Sent: donderdag 8 maart 2007 11:36 >To: Joris Dobbelsteen >Cc: Merlin Moncure; postgres general >Subject: Re: [GENERAL] sql formatter/beautifier > >Joris Dobbelsteen wrote: >> PostGreSQL (7.4 and onward) has such a thing build-in, but its not >> particulary good (simple case works, but once it gets >complex it makes >> a mess out of it). >Hi, > >Cleaning out my pgsql-general mail, I ran across your post. >How do I invoke PostgreSQL's built-in SQL beautifier? I >wasn't able to find a reference to this feature in the documentation. > >Thanks, > >-- >-------------------------------------------------------------------- >Aaron Bingham >Senior Software Engineer >Cenix BioScience GmbH >--------------------------------------------------------------------