Skip to content

Commit 65919ec

Browse files
committed
Move volatility, language, etc. modifiers before function body in the pg_dump
output for CREATE FUNCTION. This makes it easier to read especially if the function body is long. Original idea and patch by Greg Sabino Mullane, though this is a stripped down version of that.
1 parent 3ccb2c5 commit 65919ec

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/bin/pg_dump/pg_dump.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* by PostgreSQL
1313
*
1414
* IDENTIFICATION
15-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.492 2008/05/16 23:36:05 tgl Exp $
15+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.493 2008/07/01 11:46:48 heikki Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -6775,14 +6775,12 @@ dumpFunc(Archive *fout, FuncInfo *finfo)
67756775
rettypename = getFormattedTypeName(finfo->prorettype, zeroAsOpaque);
67766776

67776777
appendPQExpBuffer(q, "CREATE FUNCTION %s ", funcsig);
6778-
appendPQExpBuffer(q, "RETURNS %s%s\n %s\n LANGUAGE %s",
6778+
appendPQExpBuffer(q, "RETURNS %s%s",
67796779
(proretset[0] == 't') ? "SETOF " : "",
6780-
rettypename,
6781-
asPart->data,
6782-
fmtId(lanname));
6783-
6780+
rettypename);
67846781
free(rettypename);
67856782

6783+
appendPQExpBuffer(q, "\n LANGUAGE %s", fmtId(lanname));
67866784
if (provolatile[0] != PROVOLATILE_VOLATILE)
67876785
{
67886786
if (provolatile[0] == PROVOLATILE_IMMUTABLE)
@@ -6850,7 +6848,7 @@ dumpFunc(Archive *fout, FuncInfo *finfo)
68506848
appendStringLiteralAH(q, pos, fout);
68516849
}
68526850

6853-
appendPQExpBuffer(q, ";\n");
6851+
appendPQExpBuffer(q, "\n %s;\n", asPart->data);
68546852

68556853
ArchiveEntry(fout, finfo->dobj.catId, finfo->dobj.dumpId,
68566854
funcsig_tag,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy