@@ -9477,18 +9477,21 @@ dumpCast(Archive *fout, CastInfo *cast)
94779477appendPQExpBuffer (defqry ,"WITH INOUT" );
94789478break ;
94799479case COERCION_METHOD_FUNCTION :
9480- {
9481- char * fsig = format_function_signature (fout ,funcInfo , true);
9480+ if (funcInfo )
9481+ {
9482+ char * fsig = format_function_signature (fout ,funcInfo , true);
94829483
9483- /*
9484- * Always qualify the function name, in case it is not in
9485- * pg_catalog schema (format_function_signature won't qualify it).
9486- */
9487- appendPQExpBuffer (defqry ,"WITH FUNCTION %s.%s" ,
9488- fmtId (funcInfo -> dobj .namespace -> dobj .name ),fsig );
9489- free (fsig );
9484+ /*
9485+ * Always qualify the function name, in case it is not in
9486+ * pg_catalog schema (format_function_signature won't qualify it).
9487+ */
9488+ appendPQExpBuffer (defqry ,"WITH FUNCTION %s.%s" ,
9489+ fmtId (funcInfo -> dobj .namespace -> dobj .name ),fsig );
9490+ free (fsig );
9491+ }
9492+ else
9493+ write_msg (NULL ,"WARNING: bogus value in pg_cast.castfunc or pg_cast.castmethod field\n" );
94909494break ;
9491- }
94929495default :
94939496write_msg (NULL ,"WARNING: bogus value in pg_cast.castmethod field\n" );
94949497}