mirror of
https://github.com/postgres/postgres.git
synced 2025-05-05 09:19:17 +03:00
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:
parent
793704d71e
commit
0d32cdc38e
@ -54,7 +54,7 @@ typedef z_stream *z_streamp;
|
|||||||
|
|
||||||
#define K_VERS_MAJOR 1
|
#define K_VERS_MAJOR 1
|
||||||
#define K_VERS_MINOR 2
|
#define K_VERS_MINOR 2
|
||||||
#define K_VERS_REV 1
|
#define K_VERS_REV 2
|
||||||
|
|
||||||
/* Some important version numbers (checked in code) */
|
/* Some important version numbers (checked in code) */
|
||||||
#define K_VERS_1_0 (( (1 * 256 + 0) * 256 + 0) * 256 + 0)
|
#define K_VERS_1_0 (( (1 * 256 + 0) * 256 + 0) * 256 + 0)
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* 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 fn = createPQExpBuffer();
|
||||||
PQExpBuffer delqry = createPQExpBuffer();
|
PQExpBuffer delqry = createPQExpBuffer();
|
||||||
PQExpBuffer fnlist = createPQExpBuffer();
|
PQExpBuffer fnlist = createPQExpBuffer();
|
||||||
|
PQExpBuffer asPart = createPQExpBuffer();
|
||||||
int j;
|
int j;
|
||||||
char *func_def;
|
|
||||||
char func_lang[NAMEDATALEN + 1];
|
char func_lang[NAMEDATALEN + 1];
|
||||||
PGresult *res;
|
PGresult *res;
|
||||||
int nlangs;
|
int nlangs;
|
||||||
@ -2718,7 +2718,23 @@ dumpOneFunc(Archive *fout, FuncInfo *finfo, int i,
|
|||||||
|
|
||||||
i_lanname = PQfnumber(res, "lanname");
|
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));
|
strcpy(func_lang, PQgetvalue(res, 0, i_lanname));
|
||||||
|
|
||||||
PQclear(res);
|
PQclear(res);
|
||||||
@ -2744,10 +2760,10 @@ dumpOneFunc(Archive *fout, FuncInfo *finfo, int i,
|
|||||||
|
|
||||||
resetPQExpBuffer(q);
|
resetPQExpBuffer(q);
|
||||||
appendPQExpBuffer(q, "CREATE FUNCTION %s ", fn->data );
|
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 " : "",
|
(finfo[i].retset) ? " SETOF " : "",
|
||||||
fmtId(findTypeByOid(tinfo, numTypes, finfo[i].prorettype), false),
|
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,
|
ArchiveEntry(fout, finfo[i].oid, fn->data, "FUNCTION", NULL, q->data, delqry->data,
|
||||||
finfo[i].usename, NULL, NULL);
|
finfo[i].usename, NULL, NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user