diff options
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/catalog/pg_cast.h | 7 | ||||
| -rw-r--r-- | src/include/catalog/pg_proc.h | 22 | ||||
| -rw-r--r-- | src/include/catalog/pg_type.h | 6 | ||||
| -rw-r--r-- | src/include/nodes/execnodes.h | 18 | ||||
| -rw-r--r-- | src/include/nodes/nodes.h | 4 | ||||
| -rw-r--r-- | src/include/nodes/primnodes.h | 22 | ||||
| -rw-r--r-- | src/include/parser/parse_coerce.h | 4 | ||||
| -rw-r--r-- | src/include/pg_config.h.in | 6 | ||||
| -rw-r--r-- | src/include/utils/errcodes.h | 6 | ||||
| -rw-r--r-- | src/include/utils/xml.h | 37 |
10 files changed, 124 insertions, 8 deletions
diff --git a/src/include/catalog/pg_cast.h b/src/include/catalog/pg_cast.h index 40c0fb0ee5..942c4f906e 100644 --- a/src/include/catalog/pg_cast.h +++ b/src/include/catalog/pg_cast.h @@ -10,7 +10,7 @@ * * Copyright (c) 2002-2006, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/include/catalog/pg_cast.h,v 1.26 2006/03/05 15:58:54 momjian Exp $ + * $PostgreSQL: pgsql/src/include/catalog/pg_cast.h,v 1.27 2006/12/21 16:05:15 petere Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -300,6 +300,8 @@ 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 ( 25 142 2896 e )); /* * Cross-category casts to and from VARCHAR @@ -338,6 +340,8 @@ 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 ( 1043 142 2896 e )); /* * Cross-category casts to and from BPCHAR @@ -377,6 +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 )); /* * Length-coercion functions diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index 9dee8f6a3c..974a2db360 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.430 2006/12/06 18:06:47 neilc Exp $ + * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.431 2006/12/21 16:05:15 petere Exp $ * * NOTES * The script catalog/genbki.sh reads this file and generates .bki @@ -3976,6 +3976,26 @@ DESCR("release shared advisory lock"); DATA(insert OID = 2892 ( pg_advisory_unlock_all PGNSP PGUID 12 f f t f v 0 2278 "" _null_ _null_ _null_ pg_advisory_unlock_all - _null_ )); DESCR("release all advisory locks"); +/* XML support */ +DATA(insert OID = 2893 ( xml_in PGNSP PGUID 12 f f t f i 1 142 "2275" _null_ _null_ _null_ xml_in - _null_ )); +DESCR("I/O"); +DATA(insert OID = 2894 ( xml_out PGNSP PGUID 12 f f t f i 1 2275 "142" _null_ _null_ _null_ xml_out - _null_ )); +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_ )); +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_ )); +DESCR("validate an XML value"); + /* * Symbolic values for provolatile column: these indicate whether the result * of a function is dependent *only* on the values of its explicit arguments, diff --git a/src/include/catalog/pg_type.h b/src/include/catalog/pg_type.h index 488ff66bed..cb0c0e8574 100644 --- a/src/include/catalog/pg_type.h +++ b/src/include/catalog/pg_type.h @@ -8,7 +8,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_type.h,v 1.172 2006/10/04 00:30:08 momjian Exp $ + * $PostgreSQL: pgsql/src/include/catalog/pg_type.h,v 1.173 2006/12/21 16:05:15 petere Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -316,6 +316,10 @@ DATA(insert OID = 83 ( pg_class PGNSP PGUID -1 f c t \054 1259 0 record_in reco #define PG_CLASS_RELTYPE_OID 83 /* OIDS 100 - 199 */ +DATA(insert OID = 142 ( xml PGNSP PGUID -1 f b t \054 0 0 xml_in xml_out - - - i x f 0 -1 0 _null_ _null_ )); +DESCR("XML content"); +#define XMLOID 142 +DATA(insert OID = 143 ( _xml PGNSP PGUID -1 f b t \054 0 142 array_in array_out array_recv array_send - i x f 0 -1 0 _null_ _null_ )); /* OIDS 200 - 299 */ diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index 273d5c3326..1db920aa0c 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.162 2006/12/04 02:06:55 tgl Exp $ + * $PostgreSQL: pgsql/src/include/nodes/execnodes.h,v 1.163 2006/12/21 16:05:16 petere Exp $ * *------------------------------------------------------------------------- */ @@ -724,6 +724,22 @@ 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 c7abfba91a..eb6ba18ada 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.188 2006/09/28 20:51:42 tgl Exp $ + * $PostgreSQL: pgsql/src/include/nodes/nodes.h,v 1.189 2006/12/21 16:05:16 petere Exp $ * *------------------------------------------------------------------------- */ @@ -140,6 +140,7 @@ typedef enum NodeTag T_RangeTblRef, T_JoinExpr, T_FromExpr, + T_XmlExpr, /* * TAGS FOR EXPRESSION STATE NODES (execnodes.h) @@ -168,6 +169,7 @@ typedef enum NodeTag 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 6c5e761275..9654181bc3 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.118 2006/12/10 22:13:27 tgl Exp $ + * $PostgreSQL: pgsql/src/include/nodes/primnodes.h,v 1.119 2006/12/21 16:05:16 petere Exp $ * *------------------------------------------------------------------------- */ @@ -766,6 +766,26 @@ 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 e29a64d48f..9c077095e9 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.66 2006/10/04 00:30:09 momjian Exp $ + * $PostgreSQL: pgsql/src/include/parser/parse_coerce.h,v 1.67 2006/12/21 16:05:16 petere Exp $ * *------------------------------------------------------------------------- */ @@ -59,6 +59,8 @@ 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 Oid select_common_type(List *typeids, const char *context); extern Node *coerce_to_common_type(ParseState *pstate, Node *node, diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in index 7c1ac6b69b..a75f1dccfa 100644 --- a/src/include/pg_config.h.in +++ b/src/include/pg_config.h.in @@ -251,6 +251,9 @@ /* Define to 1 if you have the `wldap32' library (-lwldap32). */ #undef HAVE_LIBWLDAP32 +/* Define to 1 if you have the `xml2' library (-lxml2). */ +#undef HAVE_LIBXML2 + /* Define to 1 if you have the `z' library (-lz). */ #undef HAVE_LIBZ @@ -627,6 +630,9 @@ /* Define to 1 to build with LDAP support. (--with-ldap) */ #undef USE_LDAP +/* Define to 1 to build with XML support. (--with-libxml) */ +#undef USE_LIBXML + /* Define to select named POSIX semaphores. */ #undef USE_NAMED_POSIX_SEMAPHORES diff --git a/src/include/utils/errcodes.h b/src/include/utils/errcodes.h index 8ba809d2ee..9346644774 100644 --- a/src/include/utils/errcodes.h +++ b/src/include/utils/errcodes.h @@ -11,7 +11,7 @@ * * Copyright (c) 2003-2006, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/include/utils/errcodes.h,v 1.20 2006/06/16 23:29:26 tgl Exp $ + * $PostgreSQL: pgsql/src/include/utils/errcodes.h,v 1.21 2006/12/21 16:05:16 petere Exp $ * *------------------------------------------------------------------------- */ @@ -148,6 +148,10 @@ #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_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') +#define ERRCODE_INVALID_XML_PROCESSING_INSTRUCTION MAKE_SQLSTATE('2', '2', '0', '0', 'T') /* Class 23 - Integrity Constraint Violation */ #define ERRCODE_INTEGRITY_CONSTRAINT_VIOLATION MAKE_SQLSTATE('2','3', '0','0','0') diff --git a/src/include/utils/xml.h b/src/include/utils/xml.h new file mode 100644 index 0000000000..89323301d3 --- /dev/null +++ b/src/include/utils/xml.h @@ -0,0 +1,37 @@ +/*------------------------------------------------------------------------- + * + * xml.h + * Declarations for XML data type support. + * + * + * 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.1 2006/12/21 16:05:16 petere Exp $ + * + *------------------------------------------------------------------------- + */ + +#ifndef XML_H +#define XML_H + +#include "fmgr.h" + +typedef struct varlena xmltype; + +#define DatumGetXmlP(X) ((xmltype *) PG_DETOAST_DATUM(X)) + +#define PG_GETARG_XML_P(n) DatumGetXmlP(PG_GETARG_DATUM(n)) +#define PG_RETURN_XML_P(x) PG_RETURN_POINTER(x) + +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 xmlvalidate(PG_FUNCTION_ARGS); + +extern char *map_sql_identifier_to_xml_name(unsigned char *ident, bool fully_escaped); + +#endif /* XML_H */ |
