Re: pg_get_viewdefs() indentation considered harmful - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_get_viewdefs() indentation considered harmful
Date
Msg-id 5197.1398816344@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_get_viewdefs() indentation considered harmful  (Greg Stark <stark@mit.edu>)
Responses Re: pg_get_viewdefs() indentation considered harmful
List pgsql-hackers
Greg Stark <stark@mit.edu> writes:
> 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.

Actually, the patch I posted a little bit ago gets rid of that.  However,
I'm still dubious about halving the step distance, because there are
assorted places that adjust the indentation of specific keywords by
distances that aren't a multiple of 2 (look for odd last arguments to
appendContextKeyword).  I'm not sure how that will look after we make such
a change.  Possibly it would work to only apply the scale factor to
context->indentLevel, and not the indentPlus number?
        regards, tom lane



pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: pg_get_viewdefs() indentation considered harmful
Next
From: Amit Kapila
Date:
Subject: Re: Fix initdb for path with whitespace and at char