Done. In backend/commands/define.c unused field is set to '-' for the

moment.

A patch for CVS is attached, and I have amended my BLOB dumping version
appropriately.

Philip Warner
This commit is contained in:
Bruce Momjian 2000-07-11 13:07:17 +00:00
parent 793704d71e
commit 0d32cdc38e
2 changed files with 215 additions and 199 deletions

View File

@ -54,7 +54,7 @@ typedef z_stream *z_streamp;
#define K_VERS_MAJOR 1
#define K_VERS_MINOR 2
#define K_VERS_REV 1
#define K_VERS_REV 2
/* Some important version numbers (checked in code) */
#define K_VERS_1_0 (( (1 * 256 + 0) * 256 + 0) * 256 + 0)

View File

@ -22,7 +22,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.157 2000/07/06 18:39:39 wieck Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.158 2000/07/11 13:07:17 momjian Exp $
*
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
*
@ -2684,8 +2684,8 @@ dumpOneFunc(Archive *fout, FuncInfo *finfo, int i,
PQExpBuffer fn = createPQExpBuffer();
PQExpBuffer delqry = createPQExpBuffer();
PQExpBuffer fnlist = createPQExpBuffer();
PQExpBuffer asPart = createPQExpBuffer();
int j;
char *func_def;
char func_lang[NAMEDATALEN + 1];
PGresult *res;
int nlangs;
@ -2718,7 +2718,23 @@ dumpOneFunc(Archive *fout, FuncInfo *finfo, int i,
i_lanname = PQfnumber(res, "lanname");
func_def = finfo[i].prosrc;
/*
* See backend/commands/define.c for details of how the 'AS' clause
* is used.
*/
if (strcmp(finfo[i].probin, "-") != 0)
{
if (strcmp(finfo[i].prosrc, "-") != 0)
appendPQExpBuffer(asPart, "AS '%s', '%s'", finfo[i].probin, finfo[i].prosrc);
else
appendPQExpBuffer(asPart, "AS '%s'", finfo[i].probin);
}
else
{
if (strcmp(finfo[i].prosrc, "-") != 0)
appendPQExpBuffer(asPart, "AS '%s'", finfo[i].prosrc);
}
strcpy(func_lang, PQgetvalue(res, 0, i_lanname));
PQclear(res);
@ -2744,10 +2760,10 @@ dumpOneFunc(Archive *fout, FuncInfo *finfo, int i,
resetPQExpBuffer(q);
appendPQExpBuffer(q, "CREATE FUNCTION %s ", fn->data );
appendPQExpBuffer(q, "RETURNS %s%s AS '%s' LANGUAGE '%s';\n",
appendPQExpBuffer(q, "RETURNS %s%s %s LANGUAGE '%s';\n",
(finfo[i].retset) ? " SETOF " : "",
fmtId(findTypeByOid(tinfo, numTypes, finfo[i].prorettype), false),
func_def, func_lang);
asPart->data, func_lang);
ArchiveEntry(fout, finfo[i].oid, fn->data, "FUNCTION", NULL, q->data, delqry->data,
finfo[i].usename, NULL, NULL);