*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.205 2007/01/10 20:33:54 petere Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.206 2007/01/12 21:47:26 petere Exp $
*
*-------------------------------------------------------------------------
*/
value = ExecEvalExpr(e, econtext, &isnull, NULL);
if (!isnull)
{
- str = OutputFunctionCall(&xmlExpr->named_outfuncs[i],
- value);
appendStringInfo(&buf, "<%s>%s</%s>",
- argname, str, argname);
- pfree(str);
+ argname,
+ map_sql_value_to_xml_value(value, exprType((Node *) e->expr)),
+ argname);
*isNull = false;
}
i++;
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.15 2007/01/12 16:29:24 petere Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.16 2007/01/12 21:47:26 petere Exp $
*
*-------------------------------------------------------------------------
*/
static xmlChar *xml_text2xmlChar(text *in);
static xmlDocPtr xml_parse(text *data, bool is_document, bool preserve_whitespace);
-static char *map_sql_value_to_xml_value(Datum value, Oid type);
-
#endif /* USE_LIBXML */
#define NO_XML_SUPPORT() \
}
-#ifdef USE_LIBXML
/*
* Map SQL value to XML value; see SQL/XML:2003 section 9.16.
*/
-static char *
+char *
map_sql_value_to_xml_value(Datum value, Oid type)
{
StringInfoData buf;
return buf.data;
}
-#endif /* USE_LIBXML */
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/xml.h,v 1.8 2007/01/10 20:33:54 petere Exp $
+ * $PostgreSQL: pgsql/src/include/utils/xml.h,v 1.9 2007/01/12 21:47:27 petere Exp $
*
*-------------------------------------------------------------------------
*/
extern char *map_sql_identifier_to_xml_name(char *ident, bool fully_escaped);
extern char *map_xml_name_to_sql_identifier(char *name);
+extern char *map_sql_value_to_xml_value(Datum value, Oid type);
#endif /* XML_H */