diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/catalog/catversion.h | 4 | ||||
-rw-r--r-- | src/include/catalog/pg_cast.h | 8 | ||||
-rw-r--r-- | src/include/catalog/pg_proc.h | 4 | ||||
-rw-r--r-- | src/include/nodes/nodes.h | 3 | ||||
-rw-r--r-- | src/include/nodes/parsenodes.h | 13 | ||||
-rw-r--r-- | src/include/nodes/primnodes.h | 12 | ||||
-rw-r--r-- | src/include/utils/errcodes.h | 3 | ||||
-rw-r--r-- | src/include/utils/xml.h | 14 |
8 files changed, 42 insertions, 19 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index 8157a3f6a59..2f1bb8ae1a4 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -37,7 +37,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.378 2007/01/31 19:33:54 neilc Exp $ + * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.379 2007/02/03 14:06:55 petere Exp $ * *------------------------------------------------------------------------- */ @@ -53,6 +53,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 200701311 +#define CATALOG_VERSION_NO 200702031 #endif diff --git a/src/include/catalog/pg_cast.h b/src/include/catalog/pg_cast.h index 4fbf237dad2..0047f865af2 100644 --- a/src/include/catalog/pg_cast.h +++ b/src/include/catalog/pg_cast.h @@ -10,7 +10,7 @@ * * Copyright (c) 2002-2007, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/include/catalog/pg_cast.h,v 1.30 2007/01/31 19:33:54 neilc Exp $ + * $PostgreSQL: pgsql/src/include/catalog/pg_cast.h,v 1.31 2007/02/03 14:06:55 petere Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -300,7 +300,7 @@ DATA(insert ( 1266 25 939 i )); DATA(insert ( 25 1266 938 e )); DATA(insert ( 1700 25 1688 i )); DATA(insert ( 25 1700 1686 e )); -DATA(insert ( 142 25 0 e )); +DATA(insert ( 142 25 2922 e )); DATA(insert ( 25 142 2896 e )); /* @@ -340,7 +340,7 @@ DATA(insert ( 1266 1043 939 a )); DATA(insert ( 1043 1266 938 e )); DATA(insert ( 1700 1043 1688 a )); DATA(insert ( 1043 1700 1686 e )); -DATA(insert ( 142 1043 0 e )); +DATA(insert ( 142 1043 2922 e )); DATA(insert ( 1043 142 2896 e )); /* @@ -381,7 +381,7 @@ DATA(insert ( 1266 1042 939 a )); DATA(insert ( 1042 1266 938 e )); DATA(insert ( 1700 1042 1688 a )); DATA(insert ( 1042 1700 1686 e )); -DATA(insert ( 142 1042 0 e )); +DATA(insert ( 142 1042 2922 e )); /* * Length-coercion functions diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index eaee3410962..500d2395422 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.441 2007/01/28 16:16:52 neilc Exp $ + * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.442 2007/02/03 14:06:55 petere Exp $ * * NOTES * The script catalog/genbki.sh reads this file and generates .bki @@ -4045,6 +4045,8 @@ DATA(insert OID = 2900 ( xmlconcat2 PGNSP PGUID 12 1 0 f f f f i 2 142 "1 DESCR("aggregate transition function"); DATA(insert OID = 2901 ( xmlagg PGNSP PGUID 12 1 0 t f f f i 1 142 "142" _null_ _null_ _null_ aggregate_dummy - _null_ )); DESCR("concatenate XML values"); +DATA(insert OID = 2922 ( text PGNSP PGUID 12 1 0 f f t f s 1 25 "142" _null_ _null_ _null_ xmltotext - _null_ )); +DESCR("serialize an XML value to a character string"); /* uuid */ DATA(insert OID = 2952 ( uuid_in PGNSP PGUID 12 1 0 f f t f i 1 2950 "2275" _null_ _null_ _null_ uuid_in - _null_ )); diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h index f3762facdd6..2452f792940 100644 --- a/src/include/nodes/nodes.h +++ b/src/include/nodes/nodes.h @@ -7,7 +7,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/nodes.h,v 1.193 2007/01/23 05:07:18 tgl Exp $ + * $PostgreSQL: pgsql/src/include/nodes/nodes.h,v 1.194 2007/02/03 14:06:55 petere Exp $ * *------------------------------------------------------------------------- */ @@ -331,6 +331,7 @@ typedef enum NodeTag T_FunctionParameter, T_LockingClause, T_RowMarkClause, + T_XmlSerialize, /* * TAGS FOR RANDOM OTHER STUFF diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index a252308bdb2..0db72763021 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -7,7 +7,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/parsenodes.h,v 1.339 2007/01/23 05:07:18 tgl Exp $ + * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.340 2007/02/03 14:06:55 petere Exp $ * *------------------------------------------------------------------------- */ @@ -485,6 +485,17 @@ typedef struct LockingClause bool noWait; /* NOWAIT option */ } LockingClause; +/* + * XMLSERIALIZE + */ +typedef struct XmlSerialize +{ + NodeTag type; + XmlOptionType xmloption; + Node *expr; + TypeName *typename; +} XmlSerialize; + /**************************************************************************** * Nodes for a Query tree diff --git a/src/include/nodes/primnodes.h b/src/include/nodes/primnodes.h index cea0cd2f6a5..298ac0d95d6 100644 --- a/src/include/nodes/primnodes.h +++ b/src/include/nodes/primnodes.h @@ -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; /* diff --git a/src/include/utils/errcodes.h b/src/include/utils/errcodes.h index 0e4d83a8023..010918ab41f 100644 --- a/src/include/utils/errcodes.h +++ b/src/include/utils/errcodes.h @@ -11,7 +11,7 @@ * * Copyright (c) 2003-2007, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/include/utils/errcodes.h,v 1.22 2007/01/05 22:19:59 momjian Exp $ + * $PostgreSQL: pgsql/src/include/utils/errcodes.h,v 1.23 2007/02/03 14:06:56 petere Exp $ * *------------------------------------------------------------------------- */ @@ -148,6 +148,7 @@ #define ERRCODE_INVALID_BINARY_REPRESENTATION MAKE_SQLSTATE('2','2', 'P','0','3') #define ERRCODE_BAD_COPY_FILE_FORMAT MAKE_SQLSTATE('2','2', 'P','0','4') #define ERRCODE_UNTRANSLATABLE_CHARACTER MAKE_SQLSTATE('2','2', 'P','0','5') +#define ERRCODE_NOT_AN_XML_DOCUMENT MAKE_SQLSTATE('2', '2', '0', '0', 'L') #define ERRCODE_INVALID_XML_DOCUMENT MAKE_SQLSTATE('2', '2', '0', '0', 'M') #define ERRCODE_INVALID_XML_CONTENT MAKE_SQLSTATE('2', '2', '0', '0', 'N') #define ERRCODE_INVALID_XML_COMMENT MAKE_SQLSTATE('2', '2', '0', '0', 'S') diff --git a/src/include/utils/xml.h b/src/include/utils/xml.h index f5b33512cfd..f207917ea85 100644 --- a/src/include/utils/xml.h +++ b/src/include/utils/xml.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/xml.h,v 1.13 2007/01/25 11:53:51 petere Exp $ + * $PostgreSQL: pgsql/src/include/utils/xml.h,v 1.14 2007/02/03 14:06:56 petere Exp $ * *------------------------------------------------------------------------- */ @@ -17,10 +17,12 @@ #include "fmgr.h" #include "nodes/execnodes.h" +#include "nodes/primnodes.h" typedef struct varlena xmltype; #define DatumGetXmlP(X) ((xmltype *) PG_DETOAST_DATUM(X)) +#define XmlPGetDatum(X) PointerGetDatum(X) #define PG_GETARG_XML_P(n) DatumGetXmlP(PG_GETARG_DATUM(n)) #define PG_RETURN_XML_P(x) PG_RETURN_POINTER(x) @@ -32,6 +34,7 @@ extern Datum xml_send(PG_FUNCTION_ARGS); extern Datum xmlcomment(PG_FUNCTION_ARGS); extern Datum xmlconcat2(PG_FUNCTION_ARGS); extern Datum texttoxml(PG_FUNCTION_ARGS); +extern Datum xmltotext(PG_FUNCTION_ARGS); extern Datum xmlvalidate(PG_FUNCTION_ARGS); typedef enum @@ -44,10 +47,11 @@ typedef enum extern xmltype *xmlconcat(List *args); extern xmltype *xmlelement(XmlExprState *xmlExpr, ExprContext *econtext); -extern xmltype *xmlparse(text *data, bool is_doc, bool preserve_whitespace); +extern xmltype *xmlparse(text *data, XmlOptionType xmloption, bool preserve_whitespace); extern xmltype *xmlpi(char *target, text *arg, bool arg_is_null, bool *result_is_null); extern xmltype *xmlroot(xmltype *data, text *version, int standalone); extern bool xml_is_document(xmltype *arg); +extern text *xmltotext_with_xmloption(xmltype *data, XmlOptionType xmloption_arg); extern char *map_sql_identifier_to_xml_name(char *ident, bool fully_escaped); extern char *map_xml_name_to_sql_identifier(char *name); @@ -61,12 +65,6 @@ typedef enum extern XmlBinaryType xmlbinary; -typedef enum -{ - XMLOPTION_DOCUMENT, - XMLOPTION_CONTENT -} XmlOptionType; - extern XmlOptionType xmloption; #endif /* XML_H */ |