Re: Better formatting of functions in pg_dump

Lists: pgsql-patches
From: Greg Sabino Mullane <greg(at)turnstep(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: Better formatting of functions in pg_dump
Date: 2008-06-12 13:10:33
Message-ID: 20080612091033.40e02ebd@greg-laptop
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Attached patch puts the "metadata" about a function, especially the
language name, at the top of the CREATE FUNCTION statement, above the
possibly long, multi-line function definition.

--
Greg Sabino Mullane

Attachment Content-Type Size
better.pg_dump.function.format.patch text/x-patch 4.2 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Sabino Mullane <greg(at)turnstep(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Better formatting of functions in pg_dump
Date: 2008-06-12 14:40:13
Message-ID: 8911.1213281613@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Greg Sabino Mullane <greg(at)turnstep(dot)com> writes:
> Attached patch puts the "metadata" about a function, especially the
> language name, at the top of the CREATE FUNCTION statement, above the
> possibly long, multi-line function definition.

Why the random switching between newline-before and newline-after
styles? Please be consistent.

regards, tom lane


From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Better formatting of functions in pg_dump
Date: 2008-06-13 00:46:23
Message-ID: b82bbe93d6705d7527403013a8244d59@biglumber.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

>> Attached patch puts the "metadata" about a function, especially the
>> language name, at the top of the CREATE FUNCTION statement, above the
>> possibly long, multi-line function definition.

> Why the random switching between newline-before and newline-after
> styles? Please be consistent.

I thought they were all "after". On second glance, they still seem
all after?

- --
Greg Sabino Mullane greg(at)turnstep(dot)com
End Point Corporation
PGP Key: 0x14964AC8 200806122044
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAkhRww0ACgkQvJuQZxSWSshuQwCfYBjBLOVfJziHcyHRM4CNfCaY
gncAoK+CehREYJQdvAXfizZIPjZog4c6
=A+aR
-----END PGP SIGNATURE-----


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Better formatting of functions in pg_dump
Date: 2008-06-13 16:05:47
Message-ID: 11892.1213373147@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

"Greg Sabino Mullane" <greg(at)turnstep(dot)com> writes:
>> Why the random switching between newline-before and newline-after
>> styles? Please be consistent.

> I thought they were all "after". On second glance, they still seem
> all after?

Oh, my mistake, I had failed to see that the patch was getting rid of
newline-before style in this function. I think you might have gone
a bit overboard on adding whitespace, but the previous objection is
nonsense, sorry.

regards, tom lane


From: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
To: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Better formatting of functions in pg_dump
Date: 2008-07-01 11:47:26
Message-ID: 486A194E.80803@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Tom Lane wrote:
> "Greg Sabino Mullane" <greg(at)turnstep(dot)com> writes:
>>> Why the random switching between newline-before and newline-after
>>> styles? Please be consistent.
>
>> I thought they were all "after". On second glance, they still seem
>> all after?
>
> Oh, my mistake, I had failed to see that the patch was getting rid of
> newline-before style in this function. I think you might have gone
> a bit overboard on adding whitespace, but the previous objection is
> nonsense, sorry.

Yeah, I like idea of moving the "metadata" stuff before the function
body, but the whitespace is a bit too much. You can fit
" LANGUAGE plpgsql IMMUTABLE STRICT SECURITY DEFINER COST 100000" in
on one line without wrapping on a 80 col terminal. And we don't try to
guarantee any specific width anyway, you can get very long lines if the
function has a lot of arguments, for example.

I applied this simpler patch that just moves the "metadata" stuff before
the function body, leaving the whitespace as is (in newline-before style).

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

Attachment Content-Type Size
better-pg_dump-formatting-2.patch text/x-diff 1.4 KB