@@ -9477,18 +9477,21 @@ dumpCast(Archive *fout, CastInfo *cast)
9477
9477
appendPQExpBuffer (defqry ,"WITH INOUT" );
9478
9478
break ;
9479
9479
case 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);
9482
9483
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" );
9490
9494
break ;
9491
- }
9492
9495
default :
9493
9496
write_msg (NULL ,"WARNING: bogus value in pg_cast.castmethod field\n" );
9494
9497
}