提交 65919ec9 编写于 作者: H Heikki Linnakangas

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.
上级 3ccb2c59
......@@ -12,7 +12,7 @@
* by PostgreSQL
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.492 2008/05/16 23:36:05 tgl Exp $
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.493 2008/07/01 11:46:48 heikki Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -6775,14 +6775,12 @@ dumpFunc(Archive *fout, FuncInfo *finfo)
rettypename = getFormattedTypeName(finfo->prorettype, zeroAsOpaque);
appendPQExpBuffer(q, "CREATE FUNCTION %s ", funcsig);
appendPQExpBuffer(q, "RETURNS %s%s\n %s\n LANGUAGE %s",
appendPQExpBuffer(q, "RETURNS %s%s",
(proretset[0] == 't') ? "SETOF " : "",
rettypename,
asPart->data,
fmtId(lanname));
rettypename);
free(rettypename);
appendPQExpBuffer(q, "\n LANGUAGE %s", fmtId(lanname));
if (provolatile[0] != PROVOLATILE_VOLATILE)
{
if (provolatile[0] == PROVOLATILE_IMMUTABLE)
......@@ -6850,7 +6848,7 @@ dumpFunc(Archive *fout, FuncInfo *finfo)
appendStringLiteralAH(q, pos, fout);
}
appendPQExpBuffer(q, ";\n");
appendPQExpBuffer(q, "\n %s;\n", asPart->data);
ArchiveEntry(fout, finfo->dobj.catId, finfo->dobj.dumpId,
funcsig_tag,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册