RE: SQL pretty pritner?

From: Kevin Brannen <KBrannen(at)efji(dot)com>
To: stan <stanb(at)panix(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: RE: SQL pretty pritner?
Date: 2019-10-28 17:05:34
Message-ID: DM6PR19MB3451EA8C436370A9D4D46EA2A4660@DM6PR19MB3451.namprd19.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
>On 10/27/19 3:21 PM, stan wrote:
>> I have a presentation later in the week, and i plan on printing out
>> some files containing SQL commands. I have used some "pretty printers"
>> in the past for things like Perl scripts. What I am thinking of s
>> something that bolds keywords, handles page breaks, and does some formatting.
>
>http://sqlformat.darold.net/
>
>https://sourceforge.net/projects/pgformatter/

If I had that task, I'd use a combo of tools. "pgFormatter" that Adrian shows
above is what you use to reformat to make it aligned nicely, plus it does some
colorization. The first link is the online tool; the 2nd link is if you want
to download the code to your own server.

Example:
select count(*) from tablea where x is null;
Result:
SELECT
count(*)
FROM
tablea
WHERE
x IS NULL;

You can't see it here, but all the keywords are bold and colored, and "count" is
colored but not bolded.

If that colorization isn't good enough for you, then as others have said,
paste the result into "vim" to get the colorization, pasting that into
PowerPoint/Word or something that honors the colors...or just take a screen
shot of that...or whatever works for you.

HTH,
Kevin
This e-mail transmission, and any documents, files or previous e-mail messages attached to it, may contain confidential information. If you are not the intended recipient, or a person responsible for delivering it to the intended recipient, you are hereby notified that any disclosure, distribution, review, copy or use of any of the information contained in or attached to this message is STRICTLY PROHIBITED. If you have received this transmission in error, please immediately notify us by reply e-mail, and destroy the original transmission and its attachments without reading them or saving them to disk. Thank you.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Reid Thompson 2019-10-28 17:06:25 Re: SQL pretty pritner?
Previous Message ZhenHua Cai 2019-10-28 16:51:07 Re: PostgreSQL - unrecognized win32 error code: 38