Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit65919ec

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 thefunction body is long.Original idea and patch by Greg Sabino Mullane, though this is a strippeddown version of that.
1 parent3ccb2c5 commit65919ec

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)

[8]ページ先頭

©2009-2025 Movatter.jp