1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-07 00:36:50 +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:
Peter Eisentraut
2007-02-03 14:06:56 +00:00
parent 25dc46334b
commit ec020e1ceb
23 changed files with 344 additions and 99 deletions

View File

@ -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));