Skip site navigation (1) Skip section navigation (2)

Re: sql tidy formatter?

From: "David Shivak" <dshivak(at)metabolex(dot)com>
To: "Steve Atkins" <steve(at)blighty(dot)com>,"SF Postgres" <sfpug(at)postgresql(dot)org>
Subject: Re: sql tidy formatter?
Date: 2006-11-08 23:33:00
Message-ID: 745D276BAD75FB4085F6428301E852280953BD@BLOBEL.metabolex.com (view raw or flat)
Thread:
Lists: sfpug
http://www.vim.org/scripts/script.php?script_id=492

I have not used this vim script personally, but it looks like it will
prettyprint SQL.

Dave S.
____________________
David Shivak 

-----Original Message-----
From: sfpug-owner(at)postgresql(dot)org [mailto:sfpug-owner(at)postgresql(dot)org] On
Behalf Of Steve Atkins
Sent: Wednesday, November 08, 2006 3:11 PM
To: SF Postgres
Subject: Re: [sfpug] sql tidy formatter?


On Nov 8, 2006, at 3:00 PM, Jeff Frost wrote:

> Well, vim and nedit on *ix systems and textpad on windows do syntax  
> highlighting, but neither does formatting that I am aware of..by  
> formatting, I mean indenting for readability, and not just colorful  
> highlighting like I've already got with the editors.  Looks like  
> the one you sent just does the syntax highlighting.

There are a few out there that will reformat, but
they're mostly commercial.

I have "printsql.py" that seems to work for simple
stuff, somewhere around. Google should find it.

Cheers,
   Steve


>
> On Wed, 8 Nov 2006, Jon Asher wrote:
>
>> Some code / text editors recognize SQL and do basic formatting
>> (without inserting missing elements as in html tidy).  I'm not  
>> sure what's
>> best on Unix but look at this type of tool
>>
>> http://context.cx/content/view/18/41/
>>
>>
>> On 11/8/06, Jeff Frost <jeff(at)frostconsultingllc(dot)com> wrote:
>>> What do you folks use to format SQL similar to the html tidy  
>>> utility?  I
>>> get
>>> queries from clients all the time that are just one big line and  
>>> the first
>>> thing I do is edit it to make it easier to read.  I'm wondering  
>>> if there
>>> is
>>> some utility that might do this for me?
>>> --
>>> Jeff Frost, Owner       <jeff(at)frostconsultingllc(dot)com>
>>> Frost Consulting, LLC   http://www.frostconsultingllc.com/
>>> Phone: 650-780-7908     FAX: 650-649-1954
>>
>
> -- 
> Jeff Frost, Owner 	<jeff(at)frostconsultingllc(dot)com>
> Frost Consulting, LLC 	http://www.frostconsultingllc.com/
> Phone: 650-780-7908	FAX: 650-649-1954



In response to

sfpug by date

Next:From: Josh BerkusDate: 2006-11-13 05:21:49
Subject: RSVPs Needed: Tuesday's Meeting
Previous:From: Steve AtkinsDate: 2006-11-08 23:11:15
Subject: Re: sql tidy formatter?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group