Re: Fast default stuff versus pg_upgrade - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Fast default stuff versus pg_upgrade
Date
Msg-id 2895.1529616031@sss.pgh.pa.us
Whole thread Raw
In response to Re: Fast default stuff versus pg_upgrade  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> In terms of pgindent, I'm surprised about these lines:
> +    missingval = OidFunctionCall3(
> +                                  F_ARRAY_IN,

> Why did you put a newline there?  In ancient times there was a reason
> for that in some cases, because pgindent would move the argument to the
> left of the open parens, but it doesn't do that anymore and IMO it's
> just ugly.  We have quite a few leftovers from this ancient practice,
> I've been thinking about removing these ...

I think some people feel this is good style, but I agree with you
about not liking it.  A related practice I could do without is eating
an extra line for an argument-closing paren, as in this example in
tsquery_op.c:

Datum
tsq_mcontained(PG_FUNCTION_ARGS)
{
    PG_RETURN_DATUM(
                    DirectFunctionCall2(
                                        tsq_mcontains,
                                        PG_GETARG_DATUM(1),
                                        PG_GETARG_DATUM(0)
                                        )
        );
}

Aside from the waste of vertical space, it's never very clear to me
(nor, evidently, to pgindent) how such a paren ought to be indented.
So to my eye this could be four lines shorter and look better.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Fast default stuff versus pg_upgrade
Next
From: Nico Williams
Date:
Subject: Re: libpq compression