Better formatting of functions in pg_dump

Started by Greg Sabino Mullaneabout 18 years ago5 messagespatches
Jump to latest
#1Greg Sabino Mullane
greg@turnstep.com

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

Attachments:

better.pg_dump.function.format.patchtext/x-patch; name=better.pg_dump.function.format.patchDownload+22-21
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Greg Sabino Mullane (#1)
Re: Better formatting of functions in pg_dump

Greg Sabino Mullane <greg@turnstep.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

#3Greg Sabino Mullane
greg@turnstep.com
In reply to: Tom Lane (#2)
Re: Better formatting of functions in pg_dump

-----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@turnstep.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-----

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Greg Sabino Mullane (#3)
Re: Better formatting of functions in pg_dump

"Greg Sabino Mullane" <greg@turnstep.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

#5Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Tom Lane (#4)
Re: Better formatting of functions in pg_dump

Tom Lane wrote:

"Greg Sabino Mullane" <greg@turnstep.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

Attachments:

better-pg_dump-formatting-2.patchtext/x-diff; name=better-pg_dump-formatting-2.patchDownload+10-9