1 /*-------------------------------------------------------------------------
4 * Declarations for XML data type support.
7 * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
12 *-------------------------------------------------------------------------
19 #include "nodes/execnodes.h"
20 #include "nodes/primnodes.h"
22 typedef struct varlena xmltype
;
24 #define DatumGetXmlP(X) ((xmltype *) PG_DETOAST_DATUM(X))
25 #define XmlPGetDatum(X) PointerGetDatum(X)
27 #define PG_GETARG_XML_P(n) DatumGetXmlP(PG_GETARG_DATUM(n))
28 #define PG_RETURN_XML_P(x) PG_RETURN_POINTER(x)
30 extern Datum
xml_in(PG_FUNCTION_ARGS
);
31 extern Datum
xml_out(PG_FUNCTION_ARGS
);
32 extern Datum
xml_recv(PG_FUNCTION_ARGS
);
33 extern Datum
xml_send(PG_FUNCTION_ARGS
);
34 extern Datum
xmlcomment(PG_FUNCTION_ARGS
);
35 extern Datum
xmlconcat2(PG_FUNCTION_ARGS
);
36 extern Datum
texttoxml(PG_FUNCTION_ARGS
);
37 extern Datum
xmltotext(PG_FUNCTION_ARGS
);
38 extern Datum
xmlvalidate(PG_FUNCTION_ARGS
);
39 extern Datum
xpath(PG_FUNCTION_ARGS
);
41 extern Datum
table_to_xml(PG_FUNCTION_ARGS
);
42 extern Datum
query_to_xml(PG_FUNCTION_ARGS
);
43 extern Datum
cursor_to_xml(PG_FUNCTION_ARGS
);
44 extern Datum
table_to_xmlschema(PG_FUNCTION_ARGS
);
45 extern Datum
query_to_xmlschema(PG_FUNCTION_ARGS
);
46 extern Datum
cursor_to_xmlschema(PG_FUNCTION_ARGS
);
47 extern Datum
table_to_xml_and_xmlschema(PG_FUNCTION_ARGS
);
48 extern Datum
query_to_xml_and_xmlschema(PG_FUNCTION_ARGS
);
50 extern Datum
schema_to_xml(PG_FUNCTION_ARGS
);
51 extern Datum
schema_to_xmlschema(PG_FUNCTION_ARGS
);
52 extern Datum
schema_to_xml_and_xmlschema(PG_FUNCTION_ARGS
);
54 extern Datum
database_to_xml(PG_FUNCTION_ARGS
);
55 extern Datum
database_to_xmlschema(PG_FUNCTION_ARGS
);
56 extern Datum
database_to_xml_and_xmlschema(PG_FUNCTION_ARGS
);
62 XML_STANDALONE_NO_VALUE
,
63 XML_STANDALONE_OMITTED
66 extern xmltype
*xmlconcat(List
*args
);
67 extern xmltype
*xmlelement(XmlExprState
*xmlExpr
, ExprContext
*econtext
);
68 extern xmltype
*xmlparse(text
*data
, XmlOptionType xmloption
, bool preserve_whitespace
);
69 extern xmltype
*xmlpi(char *target
, text
*arg
, bool arg_is_null
, bool *result_is_null
);
70 extern xmltype
*xmlroot(xmltype
*data
, text
*version
, int standalone
);
71 extern bool xml_is_document(xmltype
*arg
);
72 extern text
*xmltotext_with_xmloption(xmltype
*data
, XmlOptionType xmloption_arg
);
74 extern char *map_sql_identifier_to_xml_name(char *ident
, bool fully_escaped
, bool escape_period
);
75 extern char *map_xml_name_to_sql_identifier(char *name
);
76 extern char *map_sql_value_to_xml_value(Datum value
, Oid type
);
78 extern void AtEOXact_xml(void);
86 extern int xmlbinary
; /* XmlBinaryType, but int for guc enum */
88 extern int xmloption
; /* XmlOptionType, but int for guc enum */