Re: pg_get_viewdefs() indentation considered harmful

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: pg_get_viewdefs() indentation considered harmful
Дата
Msg-id CAM-w4HNiGkxGGtrRcmK1-FNDf4spvRL+vS-ri_o22OKErV+EGg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pg_get_viewdefs() indentation considered harmful  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: pg_get_viewdefs() indentation considered harmful  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Tue, Apr 29, 2014 at 7:46 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I doubt you can do that (the half-size-step bit), at least not without
> a much larger patch than this: there are assorted places that just
> unconditionally append PRETTYINDENT_STD spaces, and would have to be
> taught to do something different.  OTOH those places might need to be
> adjusted anyway.

As far as I can see this is the only place that needs to be adjusted.
That function handles pretty much all the indentation. The only other
places that insert spaces just insert a fixed number in strings like
CREATE FUNCTION before the LANGUAGE or CREATE RULE before the ON.

Actually the only thing that might want to be adjusted is the
indentation in the beginning of the setop (ruleutils.c:4720) which is
what causes that long line of parentheses at the beginning of the
example. I suppose in an ideal world it would start following the
reduced spacing and wrap to new lines whenever the indentation goes
back to the left. But I can't get too excited by it in the example and
I'm not sure it's even intended to line up anyways. It just inserts
STD spaces without a newline.




-- 
greg



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pg_dump --pretty-print-views
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_get_viewdefs() indentation considered harmful