summaryrefslogtreecommitdiff
path: root/src/include/nodes/primnodes.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-12-24 00:29:20 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-12-24 00:29:20 +0000
commitc957c0bac7f9785ae2a7520a9f693eeda0ff545b (patch)
tree36d172e97e59d00d39fe1b76401b84f9a93b4e1b /src/include/nodes/primnodes.h
parent64974613c98e9928af7bbccaeb718012b1dc6769 (diff)
Code review for XML patch. Instill a bit of sanity in the location of
the XmlExpr code in various lists, use a representation that has some hope of reverse-listing correctly (though it's still a de-escaping function shy of correctness), generally try to make it look more like Postgres coding conventions.
Diffstat (limited to 'src/include/nodes/primnodes.h')
-rw-r--r--src/include/nodes/primnodes.h49
1 files changed, 28 insertions, 21 deletions
diff --git a/src/include/nodes/primnodes.h b/src/include/nodes/primnodes.h
index 5946300c975..bd2c39040fc 100644
--- a/src/include/nodes/primnodes.h
+++ b/src/include/nodes/primnodes.h
@@ -10,7 +10,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/nodes/primnodes.h,v 1.120 2006/12/23 00:43:13 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/nodes/primnodes.h,v 1.121 2006/12/24 00:29:20 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -712,6 +712,33 @@ typedef struct MinMaxExpr
} MinMaxExpr;
/*
+ * XmlExpr - various SQL/XML functions requiring special grammar productions
+ *
+ * 'name' carries the "NAME foo" argument (already XML-escaped).
+ * 'named_args' and 'arg_names' represent an xml_attribute list.
+ * 'args' carries all other arguments.
+ */
+typedef enum XmlExprOp
+{
+ IS_XMLCONCAT, /* XMLCONCAT(args) */
+ IS_XMLELEMENT, /* XMLELEMENT(name, xml_attributes, args) */
+ IS_XMLFOREST, /* XMLFOREST(xml_attributes) */
+ IS_XMLPARSE, /* XMLPARSE(text, is_doc, preserve_ws) */
+ IS_XMLPI, /* XMLPI(name [, args]) */
+ IS_XMLROOT /* XMLROOT(xml, version, standalone) */
+} XmlExprOp;
+
+typedef struct XmlExpr
+{
+ Expr xpr;
+ XmlExprOp op; /* xml function ID */
+ char *name; /* name in xml(NAME foo ...) syntaxes */
+ List *named_args; /* non-XML expressions for xml_attributes */
+ List *arg_names; /* parallel list of Value strings */
+ List *args; /* list of expressions */
+} XmlExpr;
+
+/*
* NullIfExpr - a NULLIF expression
*
* Like DistinctExpr, this is represented the same as an OpExpr referencing
@@ -766,26 +793,6 @@ typedef struct BooleanTest
} BooleanTest;
/*
- * XmlExpr - holder for SQL/XML functions XMLCONCAT,
- * XMLELEMENT, XMLFOREST
- */
-typedef enum XmlExprOp
-{
- IS_XMLCONCAT,
- IS_XMLELEMENT,
- IS_XMLFOREST,
-} XmlExprOp;
-
-typedef struct XmlExpr
-{
- Expr xpr;
- XmlExprOp op; /* xml expression type */
- char *name; /* element name */
- List *named_args;
- List *args;
-} XmlExpr;
-
-/*
* CoerceToDomain
*
* CoerceToDomain represents the operation of coercing a value to a domain