Re: pretty print viewdefs

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: pretty print viewdefs
Дата
Msg-id 407d949e0908261629y35020f8fi57c289db8a9b420a@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pretty print viewdefs  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: pretty print viewdefs  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
On Wed, Aug 26, 2009 at 11:49 PM, Andrew Dunstan<andrew@dunslane.net> wrote:
> 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.
>
> I really can't believe anyone wants a single line with 1600 column specs ...

Uhm, why not? People generally don't care about the list of columns at
all if it's just generated by "select *". If they're reading it at all
it's to see the WHERE clauses and FROM clauses and so on.

I think wrapping it at 80 columns gets the worst of both worlds. Then
you have dozens or even hundreds of lines just listing columns making
it hard to see the rest of the query. At least if it's all on one line
you can just not scroll to the right and see the rest of the query on
your screen.

An alternative to my previous compromise which might be more consistent:

List the columns one per line if *any* of the columns has an alias or
is a complex expression. If they're all simple columns then put them
all one line.

At least that way you won't have any weird column lists that switch
back and forth between styles.

-- 
greg
http://mit.edu/~gsstark/resume.pdf


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: 8.5 release timetable, again
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Logging configuration changes