Re: pg_dump --pretty-print-views
Andrew Dunstan <andrew@dunslane.net>
From: Andrew Dunstan <andrew@dunslane.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Marko Tiikkaja <pgmail@joh.to>, Jeevan Chalke <jeevan.chalke@enterprisedb.com>, David Fetter <david@fetter.org>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2013-01-31T01:07:42Z
Lists: pgsql-hackers
Attachments
- nowrap.sql (text/x-sql)
- wrap.sql (text/x-sql)
On 01/30/2013 11:03 AM, Tom Lane wrote: > Andrew Dunstan <andrew@dunslane.net> writes: >> On 01/30/2013 09:58 AM, Tom Lane wrote: >>> Marko Tiikkaja <pgmail@joh.to> writes: >>>> On 1/30/13 7:52 AM, Jeevan Chalke wrote: >>>>> However, I am not sure about putting "WRAP_COLUMN_DEFAULT" by default. In >>>>> my opinion we should put that by default but other people may object so I >>>>> will keep that in code committors plate. >>> FWIW, I'd vote for not enabling that by default --- it's basically an >>> unwarranted assumption about how wide people's terminal windows are. >> I'm not exactly sure what you're arguing for. > Maybe I'm confused - I thought the alternative Jeevan was talking about > was that we enable PRETTY_INDENT processing by default, but not > wrapColumn processing. > > Well, we could actually set the wrap value to 0, which would mean always wrap. That wouldn't be making any assumption about the user's terminal window size ;-) Here are two examples, one of which is with exactly Marko's patch which doesn't change the wrap value (i.e. leaves it at -1, meaning no wrap) , the other sets it at 0. The example is a view that is the same as information_schema.columns. Personally I find the wrapped case MUCH more readable. I guess anything is an advance, but turning on PRETTY_INDENT without turning on some level of target wrapping seems like a half-done job. cheers andrew