| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> | 
|---|---|
| To: | Andrew Dunstan <andrew(at)dunslane(dot)net> | 
| Cc: | Greg Stark <gsstark(at)mit(dot)edu>, decibel <decibel(at)decibel(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> | 
| Subject: | Re: pretty print viewdefs | 
| Date: | 2009-08-26 22:55:21 | 
| Message-ID: | 23972.1251327321@sss.pgh.pa.us | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> I do have a solution that wraps when running line length over 80 instead 
> of on every col:
>  SELECT sh.shoename, sh.sh_avail, sh.slcolor, sh.slminlen,
>     sh.slminlen * un.un_fact AS slminlen_cm, sh.slmaxlen,
>     sh.slmaxlen * un.un_fact AS slmaxlen_cm, sh.slunit
>    FROM shoe_data sh, unit un
>   WHERE sh.slunit = un.un_name;
> It's not a huge amount of code.
Well, let's see it? What do you do with expressions that don't fit?
> Maybe we need a couple of extra pg_get_viewdef() variants. One to wrap 
> on some provided line length, one to wrap on every column. psql could 
> use the first, pg_dump could use the second.
pg_dump doesn't use prettyprinting at all, and won't if I have anything
to say about it.  But I could see teaching the psql \d views to pass
along whatever psql thinks the window width is.
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Andrew Dunstan | 2009-08-26 23:12:42 | Re: pretty print viewdefs | 
| Previous Message | Josh Berkus | 2009-08-26 22:51:33 | Re: MySQL Compatibility WAS: 8.5 release timetable, again |