Andrew Dunstan <andrew@dunslane.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