mirror of
https://github.com/postgres/postgres.git
synced 2025-08-05 07:41:25 +03:00
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.
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
* by PostgreSQL
|
* by PostgreSQL
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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);
|
rettypename = getFormattedTypeName(finfo->prorettype, zeroAsOpaque);
|
||||||
|
|
||||||
appendPQExpBuffer(q, "CREATE FUNCTION %s ", funcsig);
|
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 " : "",
|
(proretset[0] == 't') ? "SETOF " : "",
|
||||||
rettypename,
|
rettypename);
|
||||||
asPart->data,
|
|
||||||
fmtId(lanname));
|
|
||||||
|
|
||||||
free(rettypename);
|
free(rettypename);
|
||||||
|
|
||||||
|
appendPQExpBuffer(q, "\n LANGUAGE %s", fmtId(lanname));
|
||||||
if (provolatile[0] != PROVOLATILE_VOLATILE)
|
if (provolatile[0] != PROVOLATILE_VOLATILE)
|
||||||
{
|
{
|
||||||
if (provolatile[0] == PROVOLATILE_IMMUTABLE)
|
if (provolatile[0] == PROVOLATILE_IMMUTABLE)
|
||||||
@@ -6850,7 +6848,7 @@ dumpFunc(Archive *fout, FuncInfo *finfo)
|
|||||||
appendStringLiteralAH(q, pos, fout);
|
appendStringLiteralAH(q, pos, fout);
|
||||||
}
|
}
|
||||||
|
|
||||||
appendPQExpBuffer(q, ";\n");
|
appendPQExpBuffer(q, "\n %s;\n", asPart->data);
|
||||||
|
|
||||||
ArchiveEntry(fout, finfo->dobj.catId, finfo->dobj.dumpId,
|
ArchiveEntry(fout, finfo->dobj.catId, finfo->dobj.dumpId,
|
||||||
funcsig_tag,
|
funcsig_tag,
|
||||||
|
Reference in New Issue
Block a user