mirror of
https://github.com/postgres/postgres.git
synced 2025-11-16 15:02:33 +03:00
Implement XMLSERIALIZE for real. Analogously, make the xml to text cast
observe the xmloption. Reorganize the representation of the XML option in the parse tree and the API to make it easier to manage and understand. Add regression tests for parsing back XML expressions.
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/nodes/primnodes.h,v 1.123 2007/01/14 13:11:54 petere Exp $
|
||||
* $PostgreSQL: pgsql/src/include/nodes/primnodes.h,v 1.124 2007/02/03 14:06:56 petere Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -726,9 +726,16 @@ typedef enum XmlExprOp
|
||||
IS_XMLPARSE, /* XMLPARSE(text, is_doc, preserve_ws) */
|
||||
IS_XMLPI, /* XMLPI(name [, args]) */
|
||||
IS_XMLROOT, /* XMLROOT(xml, version, standalone) */
|
||||
IS_XMLSERIALIZE, /* XMLSERIALIZE(is_document, xmlval) */
|
||||
IS_DOCUMENT /* xmlval IS DOCUMENT */
|
||||
} XmlExprOp;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
XMLOPTION_DOCUMENT,
|
||||
XMLOPTION_CONTENT
|
||||
} XmlOptionType;
|
||||
|
||||
typedef struct XmlExpr
|
||||
{
|
||||
Expr xpr;
|
||||
@@ -737,6 +744,9 @@ typedef struct XmlExpr
|
||||
List *named_args; /* non-XML expressions for xml_attributes */
|
||||
List *arg_names; /* parallel list of Value strings */
|
||||
List *args; /* list of expressions */
|
||||
XmlOptionType xmloption; /* DOCUMENT or CONTENT */
|
||||
Oid type; /* target type for XMLSERIALIZE */
|
||||
int32 typmod;
|
||||
} XmlExpr;
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user