summaryrefslogtreecommitdiff
path: root/src/backend/nodes/copyfuncs.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2007-02-03 14:06:56 +0000
committerPeter Eisentraut <peter_e@gmx.net>2007-02-03 14:06:56 +0000
commitec020e1ceb94d0ceb3c0eee8c39cd197be7bb3cb (patch)
tree99f52eea439dd239d8e9a7f04f70f567b88ee798 /src/backend/nodes/copyfuncs.c
parent25dc46334b99f3161d931a608fb49f6eced42065 (diff)
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.
Diffstat (limited to 'src/backend/nodes/copyfuncs.c')
-rw-r--r--src/backend/nodes/copyfuncs.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
index f213f216de4..2d38d7fd60c 100644
--- a/src/backend/nodes/copyfuncs.c
+++ b/src/backend/nodes/copyfuncs.c
@@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.364 2007/01/23 05:07:17 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.365 2007/02/03 14:06:54 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1116,6 +1116,9 @@ _copyXmlExpr(XmlExpr *from)
COPY_NODE_FIELD(named_args);
COPY_NODE_FIELD(arg_names);
COPY_NODE_FIELD(args);
+ COPY_SCALAR_FIELD(xmloption);
+ COPY_SCALAR_FIELD(type);
+ COPY_SCALAR_FIELD(typmod);
return newnode;
}
@@ -1723,6 +1726,18 @@ _copyLockingClause(LockingClause *from)
return newnode;
}
+static XmlSerialize *
+_copyXmlSerialize(XmlSerialize *from)
+{
+ XmlSerialize *newnode = makeNode(XmlSerialize);
+
+ COPY_SCALAR_FIELD(xmloption);
+ COPY_NODE_FIELD(expr);
+ COPY_NODE_FIELD(typename);
+
+ return newnode;
+}
+
static Query *
_copyQuery(Query *from)
{
@@ -3430,6 +3445,9 @@ copyObject(void *from)
case T_FuncWithArgs:
retval = _copyFuncWithArgs(from);
break;
+ case T_XmlSerialize:
+ retval = _copyXmlSerialize(from);
+ break;
default:
elog(ERROR, "unrecognized node type: %d", (int) nodeTag(from));