diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/catalog/catversion.h | 4 | ||||
-rw-r--r-- | src/include/catalog/pg_proc.h | 14 | ||||
-rw-r--r-- | src/include/nodes/execnodes.h | 30 | ||||
-rw-r--r-- | src/include/nodes/nodes.h | 6 | ||||
-rw-r--r-- | src/include/nodes/primnodes.h | 49 | ||||
-rw-r--r-- | src/include/parser/parse_coerce.h | 11 | ||||
-rw-r--r-- | src/include/utils/xml.h | 10 |
7 files changed, 59 insertions, 65 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index f0a840a3dde..68f5a639347 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -37,7 +37,7 @@ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.365 2006/12/23 00:43:12 tgl Exp $ + * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.366 2006/12/24 00:29:19 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -53,6 +53,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 200612221 +#define CATALOG_VERSION_NO 200612231 #endif diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index 974a2db360c..0a3ccc07f6c 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.431 2006/12/21 16:05:15 petere Exp $ + * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.432 2006/12/24 00:29:19 tgl Exp $ * * NOTES * The script catalog/genbki.sh reads this file and generates .bki @@ -3983,17 +3983,9 @@ DATA(insert OID = 2894 ( xml_out PGNSP PGUID 12 f f t f i 1 2275 "142" _nul DESCR("I/O"); DATA(insert OID = 2895 ( xmlcomment PGNSP PGUID 12 f f t f i 1 142 "25" _null_ _null_ _null_ xmlcomment - _null_ )); DESCR("generate an XML comment"); -DATA(insert OID = 2896 ( xmlparse PGNSP PGUID 12 f f t f i 1 142 "25" _null_ _null_ _null_ xmlparse - _null_ )); +DATA(insert OID = 2896 ( xml PGNSP PGUID 12 f f t f i 1 142 "25" _null_ _null_ _null_ texttoxml - _null_ )); DESCR("perform a non-validating parse of a character string to produce an XML value"); -DATA(insert OID = 2897 ( xmlparse PGNSP PGUID 12 f f t f i 3 142 "25 16 16" _null_ _null_ _null_ xmlparse - _null_ )); -DESCR("perform a non-validating parse of a character string to produce an XML value"); -DATA(insert OID = 2898 ( xmlpi PGNSP PGUID 12 f f t f i 1 142 "19" _null_ _null_ _null_ xmlpi - _null_ )); -DESCR("generate an XML processing instruction"); -DATA(insert OID = 2899 ( xmlpi PGNSP PGUID 12 f f t f i 2 142 "19 25" _null_ _null_ _null_ xmlpi - _null_ )); -DESCR("generate an XML processing instruction"); -DATA(insert OID = 2900 ( xmlroot PGNSP PGUID 12 f f f f i 3 142 "142 25 16" _null_ _null_ _null_ xmlroot - _null_ )); -DESCR("create an XML value by modifying the properties of the XML root information item of another XML value"); -DATA(insert OID = 2901 ( xmlvalidate PGNSP PGUID 12 f f t f i 2 16 "142 25" _null_ _null_ _null_ xmlvalidate - _null_ )); +DATA(insert OID = 2897 ( xmlvalidate PGNSP PGUID 12 f f t f i 2 16 "142 25" _null_ _null_ _null_ xmlvalidate - _null_ )); DESCR("validate an XML value"); /* diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index 1db920aa0c1..f8e8f15a5db 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -7,7 +7,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/execnodes.h,v 1.163 2006/12/21 16:05:16 petere Exp $ + * $PostgreSQL: pgsql/src/include/nodes/execnodes.h,v 1.164 2006/12/24 00:29:20 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -711,6 +711,18 @@ typedef struct MinMaxExprState } MinMaxExprState; /* ---------------- + * XmlExprState node + * ---------------- + */ +typedef struct XmlExprState +{ + ExprState xprstate; + List *named_args; /* ExprStates for named arguments */ + FmgrInfo *named_outfuncs; /* array of output fns for named arguments */ + List *args; /* ExprStates for other arguments */ +} XmlExprState; + +/* ---------------- * NullTestState node * ---------------- */ @@ -724,22 +736,6 @@ typedef struct NullTestState } NullTestState; /* ---------------- - * XmlExprState node - * ---------------- - */ -typedef struct XmlExprState -{ - ExprState xprstate; - XmlExprOp op; - char *name; - List *named_args; - List *args; - Oid *named_args_tcache; - char **named_args_ncache; - Oid arg_typeout; -} XmlExprState; - -/* ---------------- * CoerceToDomainState node * ---------------- */ diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h index eb6ba18adab..fa9dff9d961 100644 --- a/src/include/nodes/nodes.h +++ b/src/include/nodes/nodes.h @@ -7,7 +7,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/nodes.h,v 1.189 2006/12/21 16:05:16 petere Exp $ + * $PostgreSQL: pgsql/src/include/nodes/nodes.h,v 1.190 2006/12/24 00:29:20 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -130,6 +130,7 @@ typedef enum NodeTag T_RowCompareExpr, T_CoalesceExpr, T_MinMaxExpr, + T_XmlExpr, T_NullIfExpr, T_NullTest, T_BooleanTest, @@ -140,7 +141,6 @@ typedef enum NodeTag T_RangeTblRef, T_JoinExpr, T_FromExpr, - T_XmlExpr, /* * TAGS FOR EXPRESSION STATE NODES (execnodes.h) @@ -166,10 +166,10 @@ typedef enum NodeTag T_RowCompareExprState, T_CoalesceExprState, T_MinMaxExprState, + T_XmlExprState, T_NullTestState, T_CoerceToDomainState, T_DomainConstraintState, - T_XmlExprState, /* * TAGS FOR PLANNER NODES (relation.h) 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 diff --git a/src/include/parser/parse_coerce.h b/src/include/parser/parse_coerce.h index 9c077095e9e..08573abd1ef 100644 --- a/src/include/parser/parse_coerce.h +++ b/src/include/parser/parse_coerce.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/parser/parse_coerce.h,v 1.67 2006/12/21 16:05:16 petere Exp $ + * $PostgreSQL: pgsql/src/include/parser/parse_coerce.h,v 1.68 2006/12/24 00:29:20 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -55,12 +55,9 @@ extern Node *coerce_to_domain(Node *arg, Oid baseTypeId, int32 baseTypeMod, extern Node *coerce_to_boolean(ParseState *pstate, Node *node, const char *constructName); -extern Node *coerce_to_integer(ParseState *pstate, Node *node, - const char *constructName); -extern Node *coerce_to_bigint(ParseState *pstate, Node *node, - const char *constructName); -extern Node *coerce_to_xml(ParseState *pstate, Node *node, - const char *constructName); +extern Node *coerce_to_specific_type(ParseState *pstate, Node *node, + Oid targetTypeId, + const char *constructName); extern Oid select_common_type(List *typeids, const char *context); extern Node *coerce_to_common_type(ParseState *pstate, Node *node, diff --git a/src/include/utils/xml.h b/src/include/utils/xml.h index a353d8837c9..713bdaeb115 100644 --- a/src/include/utils/xml.h +++ b/src/include/utils/xml.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/xml.h,v 1.2 2006/12/23 04:56:50 tgl Exp $ + * $PostgreSQL: pgsql/src/include/utils/xml.h,v 1.3 2006/12/24 00:29:20 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -27,11 +27,13 @@ typedef struct varlena xmltype; extern Datum xml_in(PG_FUNCTION_ARGS); extern Datum xml_out(PG_FUNCTION_ARGS); extern Datum xmlcomment(PG_FUNCTION_ARGS); -extern Datum xmlparse(PG_FUNCTION_ARGS); -extern Datum xmlpi(PG_FUNCTION_ARGS); -extern Datum xmlroot(PG_FUNCTION_ARGS); +extern Datum texttoxml(PG_FUNCTION_ARGS); extern Datum xmlvalidate(PG_FUNCTION_ARGS); +extern xmltype *xmlparse(text *data, bool is_doc, bool preserve_whitespace); +extern xmltype *xmlpi(char *target, text *arg); +extern xmltype *xmlroot(xmltype *data, text *version, int standalone); + extern char *map_sql_identifier_to_xml_name(char *ident, bool fully_escaped); #endif /* XML_H */ |