diff --git a/contrib/xml2/xpath.c b/contrib/xml2/xpath.c
index a003dd00c82132dabfb74108341deff19591fffb..b1a4e9ac9d644d4cf7b8d172d755d10b7e10e82e 100644
--- a/contrib/xml2/xpath.c
+++ b/contrib/xml2/xpath.c
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/xml2/xpath.c,v 1.24 2009/12/29 17:40:59 heikki Exp $
+ * $PostgreSQL: pgsql/contrib/xml2/xpath.c,v 1.25 2010/01/17 12:11:25 mha Exp $
  *
  * Parser interface for DOM-based parser (libxml) rather than
  * stream-based SAX-type parser
@@ -129,7 +129,7 @@ elog_error(int level, char *explain, int force)
 		if (pgxml_errorMsg == NULL)
 		{
 			ereport(level, (errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION),
-							errmsg(explain)));
+							errmsg("%s", explain)));
 		}
 		else
 		{