*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.305.2.9 2003/10/28 21:05:39 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.305.2.10 2004/03/02 21:15:15 tgl Exp $
*
*-------------------------------------------------------------------------
*/
if (strcmp(castfunc, "0") == 0)
appendPQExpBuffer(defqry, "WITHOUT FUNCTION");
else
- appendPQExpBuffer(defqry, "WITH FUNCTION %s",
- format_function_signature(&finfo[fidx], true));
+ {
+ /*
+ * Always qualify the function name, in case it is not in
+ * pg_catalog schema (format_function_signature won't qualify it).
+ */
+ appendPQExpBuffer(defqry, "WITH FUNCTION %s.",
+ fmtId(finfo[fidx].pronamespace->nspname));
+ appendPQExpBuffer(defqry, "%s",
+ format_function_signature(&finfo[fidx], true));
+ }
if (strcmp(castcontext, "a") == 0)
appendPQExpBuffer(defqry, " AS ASSIGNMENT");