PostgreSQL Source Code
git master
|
#include "executor/tablefunc.h"
#include "fmgr.h"
#include "nodes/execnodes.h"
#include "nodes/primnodes.h"
Go to the source code of this file.
Macros | |
#define | PG_GETARG_XML_P(n) DatumGetXmlP(PG_GETARG_DATUM(n)) |
#define | PG_RETURN_XML_P(x) PG_RETURN_POINTER(x) |
Typedefs | |
typedef struct varlena | xmltype |
typedef struct PgXmlErrorContext | PgXmlErrorContext |
Enumerations | |
enum | XmlStandaloneType { XML_STANDALONE_YES , XML_STANDALONE_NO , XML_STANDALONE_NO_VALUE , XML_STANDALONE_OMITTED } |
enum | XmlBinaryType { XMLBINARY_BASE64 , XMLBINARY_HEX } |
enum | PgXmlStrictness { PG_XML_STRICTNESS_LEGACY , PG_XML_STRICTNESS_WELLFORMED , PG_XML_STRICTNESS_ALL } |
Functions | |
static xmltype * | DatumGetXmlP (Datum X) |
static Datum | XmlPGetDatum (const xmltype *X) |
void | pg_xml_init_library (void) |
PgXmlErrorContext * | pg_xml_init (PgXmlStrictness strictness) |
void | pg_xml_done (PgXmlErrorContext *errcxt, bool isError) |
bool | pg_xml_error_occurred (PgXmlErrorContext *errcxt) |
void | xml_ereport (PgXmlErrorContext *errcxt, int level, int sqlcode, const char *msg) |
xmltype * | xmlconcat (List *args) |
xmltype * | xmlelement (XmlExpr *xexpr, Datum *named_argvalue, bool *named_argnull, Datum *argvalue, bool *argnull) |
xmltype * | xmlparse (text *data, XmlOptionType xmloption_arg, bool preserve_whitespace) |
xmltype * | xmlpi (const char *target, text *arg, bool arg_is_null, bool *result_is_null) |
xmltype * | xmlroot (xmltype *data, text *version, int standalone) |
bool | xml_is_document (xmltype *arg) |
text * | xmltotext_with_options (xmltype *data, XmlOptionType xmloption_arg, bool indent) |
char * | escape_xml (const char *str) |
char * | map_sql_identifier_to_xml_name (const char *ident, bool fully_escaped, bool escape_period) |
char * | map_xml_name_to_sql_identifier (const char *name) |
char * | map_sql_value_to_xml_value (Datum value, Oid type, bool xml_escape_strings) |
Variables | |
PGDLLIMPORT int | xmlbinary |
PGDLLIMPORT int | xmloption |
PGDLLIMPORT const TableFuncRoutine | XmlTableRoutine |
#define PG_GETARG_XML_P | ( | n | ) | DatumGetXmlP(PG_GETARG_DATUM(n)) |
#define PG_RETURN_XML_P | ( | x | ) | PG_RETURN_POINTER(x) |
typedef struct PgXmlErrorContext PgXmlErrorContext |
enum PgXmlStrictness |
enum XmlBinaryType |
enum XmlStandaloneType |
Definition at line 51 of file xml.h.
References PG_DETOAST_DATUM.
Referenced by ExecEvalXmlExpr(), xmlconcat(), and XmlTableSetDocument().
char* escape_xml | ( | const char * | str | ) |
Definition at line 2603 of file xml.c.
References appendStringInfoCharMacro, appendStringInfoString(), buf, initStringInfo(), and generate_unaccent_rules::str.
Referenced by ExplainProperty(), ExplainPropertyList(), map_sql_value_to_xml_value(), and XmlTableGetValue().
Definition at line 2286 of file xml.c.
References appendBinaryStringInfo(), appendStringInfo(), appendStringInfoString(), Assert(), buf, ident, initStringInfo(), NO_XML_SUPPORT, pg_mblen(), and pg_strncasecmp().
Referenced by database_to_xml_internal(), map_multipart_sql_identifier_to_xml_name(), map_sql_catalog_to_xmlschema_types(), map_sql_schema_to_xmlschema_types(), map_sql_table_to_xmlschema(), query_to_xml_internal(), schema_to_xml_internal(), SPI_sql_row_to_xmlelement(), and transformXmlExpr().
Definition at line 2384 of file xml.c.
References appendStringInfoString(), ARR_ELEMTYPE, buf, DATE_NOT_FINITE, DatumGetArrayTypeP, DatumGetBool(), DatumGetByteaPP, DatumGetDateADT(), DatumGetTimestamp(), deconstruct_array(), EncodeDateOnly(), EncodeDateTime(), ereport, errcode(), errdetail(), errmsg(), ERROR, escape_xml(), get_typlenbyvalalign(), getBaseType(), getTypeOutputInfo(), i, initStringInfo(), j2date(), MAXDATELEN, OidOutputFunctionCall(), pfree(), PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, pg_xml_done(), pg_xml_init(), PG_XML_STRICTNESS_ALL, POSTGRES_EPOCH_JDATE, pstrdup(), generate_unaccent_rules::str, timestamp2tm(), TIMESTAMP_NOT_FINITE, tm, pg_tm::tm_mday, pg_tm::tm_mon, pg_tm::tm_year, generate_unaccent_rules::type, type_is_array_domain, USE_XSD_DATES, value, VARDATA_ANY, VARSIZE_ANY_EXHDR, xml_ereport(), xmlbinary, and XMLBINARY_BASE64.
Referenced by ExecEvalXmlExpr(), SPI_sql_row_to_xmlelement(), and xmlelement().
char* map_xml_name_to_sql_identifier | ( | const char * | name | ) |
Definition at line 2342 of file xml.c.
References appendBinaryStringInfo(), appendStringInfoString(), buf, initStringInfo(), MAX_UNICODE_EQUIVALENT_STRING, name, pg_mblen(), and pg_unicode_to_server().
Referenced by get_rule_expr().
void pg_xml_done | ( | PgXmlErrorContext * | errcxt, |
bool | isError | ||
) |
bool pg_xml_error_occurred | ( | PgXmlErrorContext * | errcxt | ) |
PgXmlErrorContext* pg_xml_init | ( | PgXmlStrictness | strictness | ) |
Referenced by map_sql_value_to_xml_value(), pgxml_parser_init(), xmlelement(), XmlTableInitOpaque(), and xmltotext_with_options().
void pg_xml_init_library | ( | void | ) |
void xml_ereport | ( | PgXmlErrorContext * | errcxt, |
int | level, | ||
int | sqlcode, | ||
const char * | msg | ||
) |
Definition at line 1065 of file xml.c.
References arg, ErrorSaveContext::error_occurred, GetDatabaseEncoding(), NO_XML_SUPPORT, and XMLOPTION_DOCUMENT.
Referenced by ExecEvalXmlExpr().
Definition at line 522 of file xml.c.
References appendBinaryStringInfo(), appendStringInfoString(), generate_unaccent_rules::args, buf, DatumGetXmlP(), initStringInfo(), len, lfirst, NO_XML_SUPPORT, pfree(), PointerGetDatum(), generate_unaccent_rules::str, stringinfo_to_xmltype(), text_to_cstring(), VARHDRSZ, VARSIZE, and x.
Referenced by ExecEvalXmlExpr(), and xmlconcat2().
xmltype* xmlelement | ( | XmlExpr * | xexpr, |
Datum * | named_argvalue, | ||
bool * | named_argnull, | ||
Datum * | argvalue, | ||
bool * | argnull | ||
) |
Definition at line 805 of file xml.c.
References arg, XmlExpr::args, buf, ERROR, exprType(), forboth, i, lappend(), lfirst, map_sql_value_to_xml_value(), XmlExpr::named_args, NIL, NO_XML_SUPPORT, PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, pg_xml_done(), pg_xml_init(), PG_XML_STRICTNESS_ALL, generate_unaccent_rules::str, strVal, and xml_ereport().
Referenced by ExecEvalXmlExpr().
xmltype* xmlparse | ( | text * | data, |
XmlOptionType | xmloption_arg, | ||
bool | preserve_whitespace | ||
) |
Definition at line 929 of file xml.c.
References data, GetDatabaseEncoding(), and NO_XML_SUPPORT.
Referenced by ExecEvalXmlExpr(), and texttoxml().
Definition at line 57 of file xml.h.
References PointerGetDatum().
Definition at line 947 of file xml.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), arg, buf, ereport, errcode(), errdetail(), errmsg(), ERROR, initStringInfo(), NO_XML_SUPPORT, pfree(), pg_strcasecmp(), stringinfo_to_xmltype(), and text_to_cstring().
Referenced by ExecEvalXmlExpr().
Definition at line 999 of file xml.c.
References appendStringInfoString(), buf, data, initStringInfo(), len, NO_XML_SUPPORT, generate_unaccent_rules::str, stringinfo_to_xmltype(), text_to_cstring(), VARHDRSZ, VARSIZE, XML_STANDALONE_NO, XML_STANDALONE_NO_VALUE, XML_STANDALONE_OMITTED, and XML_STANDALONE_YES.
Referenced by ExecEvalXmlExpr().
text* xmltotext_with_options | ( | xmltype * | data, |
XmlOptionType | xmloption_arg, | ||
bool | indent | ||
) |
Definition at line 625 of file xml.c.
References buf, data, ereport, errcode(), errmsg(), ERROR, ErrorSaveContext::error_occurred, GetDatabaseEncoding(), newline, NO_XML_SUPPORT, PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, pg_xml_done(), pg_xml_init(), PG_XML_STRICTNESS_ALL, xml_ereport(), and XMLOPTION_DOCUMENT.
Referenced by ExecEvalXmlExpr().
|
extern |
Definition at line 99 of file xml.c.
Referenced by map_sql_type_to_xmlschema_type(), and map_sql_value_to_xml_value().
|
extern |
Definition at line 100 of file xml.c.
Referenced by texttoxml(), xml_in(), xml_is_well_formed(), and xml_recv().
|
extern |
Definition at line 213 of file xml.c.
Referenced by ExecInitTableFuncScan().