PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/htup_details.h"
#include "access/table.h"
#include "catalog/namespace.h"
#include "catalog/pg_class.h"
#include "catalog/pg_type.h"
#include "commands/dbcommands.h"
#include "executor/spi.h"
#include "executor/tablefunc.h"
#include "fmgr.h"
#include "lib/stringinfo.h"
#include "libpq/pqformat.h"
#include "mb/pg_wchar.h"
#include "miscadmin.h"
#include "nodes/execnodes.h"
#include "nodes/miscnodes.h"
#include "nodes/nodeFuncs.h"
#include "utils/array.h"
#include "utils/builtins.h"
#include "utils/date.h"
#include "utils/datetime.h"
#include "utils/lsyscache.h"
#include "utils/rel.h"
#include "utils/syscache.h"
#include "utils/xml.h"
Go to the source code of this file.
Macros | |
#define | NO_XML_SUPPORT() |
#define | NAMESPACE_XSD "http://www.w3.org/2001/XMLSchema" |
#define | NAMESPACE_XSI "http://www.w3.org/2001/XMLSchema-instance" |
#define | NAMESPACE_SQLXML "http://standards.iso.org/iso/9075/2003/sqlxml" |
#define | PG_XML_DEFAULT_VERSION "1.0" |
#define | XML_VISIBLE_SCHEMAS_EXCLUDE "(nspname ~ '^pg_' OR nspname = 'information_schema')" |
#define | XML_VISIBLE_SCHEMAS "SELECT oid FROM pg_catalog.pg_namespace WHERE pg_catalog.has_schema_privilege (oid, 'USAGE') AND NOT " XML_VISIBLE_SCHEMAS_EXCLUDE |
Variables | |
int | xmlbinary = XMLBINARY_BASE64 |
int | xmloption = XMLOPTION_CONTENT |
const TableFuncRoutine | XmlTableRoutine |
#define NAMESPACE_SQLXML "http://standards.iso.org/iso/9075/2003/sqlxml" |
#define NAMESPACE_XSI "http://www.w3.org/2001/XMLSchema-instance" |
#define NO_XML_SUPPORT | ( | ) |
#define XML_VISIBLE_SCHEMAS "SELECT oid FROM pg_catalog.pg_namespace WHERE pg_catalog.has_schema_privilege (oid, 'USAGE') AND NOT " XML_VISIBLE_SCHEMAS_EXCLUDE |
#define XML_VISIBLE_SCHEMAS_EXCLUDE "(nspname ~ '^pg_' OR nspname = 'information_schema')" |
|
static |
Definition at line 2727 of file xml.c.
References len, and SPI_palloc().
Referenced by cursor_to_xmlschema(), query_to_xml_and_xmlschema(), and query_to_xmlschema().
|
static |
Definition at line 474 of file xml.c.
References cstring_to_text().
Referenced by cursor_to_xmlschema(), query_to_xmlschema(), and table_to_xmlschema().
Datum cursor_to_xml | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2911 of file xml.c.
References appendStringInfoChar(), ereport, errcode(), errmsg(), ERROR, i, initStringInfo(), name, PG_GETARG_BOOL, PG_GETARG_INT32, PG_GETARG_TEXT_PP, PG_RETURN_XML_P, SPI_connect(), SPI_cursor_fetch(), SPI_cursor_find(), SPI_finish(), SPI_processed, SPI_sql_row_to_xmlelement(), stringinfo_to_xmltype(), text_to_cstring(), xmldata_root_element_end(), and xmldata_root_element_start().
Datum cursor_to_xmlschema | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3092 of file xml.c.
References _SPI_strdup(), cstring_to_xmltype(), ereport, errcode(), errmsg(), ERROR, InvalidOid, map_sql_table_to_xmlschema(), name, PG_GETARG_BOOL, PG_GETARG_TEXT_PP, PG_RETURN_XML_P, SPI_connect(), SPI_cursor_find(), SPI_finish(), text_to_cstring(), and PortalData::tupDesc.
|
static |
Definition at line 2840 of file xml.c.
References query_to_oid_list(), and XML_VISIBLE_SCHEMAS.
Referenced by database_to_xml_internal(), and database_to_xmlschema_internal().
|
static |
Definition at line 2847 of file xml.c.
References CppAsString2, query_to_oid_list(), and XML_VISIBLE_SCHEMAS.
Referenced by database_to_xmlschema_internal().
Datum database_to_xml | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3397 of file xml.c.
References database_to_xml_internal(), PG_GETARG_BOOL, PG_GETARG_TEXT_PP, PG_RETURN_XML_P, stringinfo_to_xmltype(), and text_to_cstring().
Datum database_to_xml_and_xmlschema | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3464 of file xml.c.
References StringInfoData::data, database_to_xml_internal(), database_to_xmlschema_internal(), PG_GETARG_BOOL, PG_GETARG_TEXT_PP, PG_RETURN_XML_P, stringinfo_to_xmltype(), and text_to_cstring().
|
static |
Definition at line 3354 of file xml.c.
References appendBinaryStringInfo(), appendStringInfo(), appendStringInfoChar(), StringInfoData::data, database_get_xml_visible_schemas(), get_database_name(), StringInfoData::len, lfirst_oid, makeStringInfo(), map_sql_identifier_to_xml_name(), MyDatabaseId, nspid, schema_to_xml_internal(), SPI_connect(), SPI_finish(), xmldata_root_element_end(), and xmldata_root_element_start().
Referenced by database_to_xml(), and database_to_xml_and_xmlschema().
Datum database_to_xmlschema | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3452 of file xml.c.
References database_to_xmlschema_internal(), PG_GETARG_BOOL, PG_GETARG_TEXT_PP, PG_RETURN_XML_P, stringinfo_to_xmltype(), and text_to_cstring().
|
static |
Definition at line 3409 of file xml.c.
References AccessShareLock, appendStringInfoString(), CreateTupleDescCopy(), database_get_xml_visible_schemas(), database_get_xml_visible_tables(), lappend(), lfirst_oid, makeStringInfo(), map_sql_catalog_to_xmlschema_types(), map_sql_typecoll_to_xmlschema_types(), NIL, NoLock, RelationData::rd_att, SPI_connect(), SPI_finish(), table_close(), table_open(), xsd_schema_element_end(), and xsd_schema_element_start().
Referenced by database_to_xml_and_xmlschema(), and database_to_xmlschema().
char* escape_xml | ( | const char * | str | ) |
Definition at line 2695 of file xml.c.
References appendStringInfoCharMacro, appendStringInfoString(), buf, initStringInfo(), and str.
Referenced by ExplainProperty(), ExplainPropertyList(), map_sql_value_to_xml_value(), and XmlTableGetValue().
|
static |
Definition at line 3483 of file xml.c.
References a, appendStringInfo(), appendStringInfoString(), b, StringInfoData::data, initStringInfo(), and map_sql_identifier_to_xml_name().
Referenced by map_sql_catalog_to_xmlschema_types(), map_sql_schema_to_xmlschema_types(), map_sql_table_to_xmlschema(), and map_sql_type_to_xml_name().
|
static |
Definition at line 3692 of file xml.c.
References appendStringInfo(), appendStringInfoString(), StringInfoData::data, dbname, get_database_name(), get_namespace_name(), initStringInfo(), lfirst_oid, map_multipart_sql_identifier_to_xml_name(), map_sql_identifier_to_xml_name(), MyDatabaseId, and nspid.
Referenced by database_to_xmlschema_internal().
char* map_sql_identifier_to_xml_name | ( | const char * | ident, |
bool | fully_escaped, | ||
bool | escape_period | ||
) |
Definition at line 2378 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().
|
static |
Definition at line 3619 of file xml.c.
References appendStringInfo(), appendStringInfoString(), StringInfoData::data, dbname, get_database_name(), get_namespace_name(), get_rel_name(), initStringInfo(), lfirst_oid, map_multipart_sql_identifier_to_xml_name(), map_sql_identifier_to_xml_name(), MyDatabaseId, nspid, and relname.
Referenced by schema_to_xmlschema_internal().
|
static |
Definition at line 3514 of file xml.c.
References appendStringInfo(), appendStringInfoString(), StringInfoData::data, elog, ERROR, get_database_name(), get_namespace_name(), GETSTRUCT, HeapTupleIsValid, i, initStringInfo(), list_make1, map_multipart_sql_identifier_to_xml_name(), map_sql_identifier_to_xml_name(), map_sql_type_to_xml_name(), map_sql_typecoll_to_xmlschema_types(), MyDatabaseId, NameStr, TupleDescData::natts, ObjectIdGetDatum(), OidIsValid, ReleaseSysCache(), SearchSysCache1(), TupleDescAttr, xsd_schema_element_end(), and xsd_schema_element_start().
Referenced by cursor_to_xmlschema(), query_to_xml_and_xmlschema(), query_to_xmlschema(), table_to_xml_and_xmlschema(), and table_to_xmlschema().
|
static |
Definition at line 3749 of file xml.c.
References appendStringInfo(), appendStringInfoString(), StringInfoData::data, elog, ERROR, get_database_name(), get_namespace_name(), GETSTRUCT, HeapTupleIsValid, initStringInfo(), map_multipart_sql_identifier_to_xml_name(), MyDatabaseId, NameStr, ObjectIdGetDatum(), ReleaseSysCache(), SearchSysCache1(), and VARHDRSZ.
Referenced by map_sql_table_to_xmlschema(), and map_sql_type_to_xmlschema_type().
|
static |
Definition at line 3909 of file xml.c.
References appendStringInfo(), appendStringInfoString(), StringInfoData::data, get_typtype(), getBaseTypeAndTypmod(), initStringInfo(), INT64_FORMAT, map_sql_type_to_xml_name(), PG_INT64_MAX, PG_INT64_MIN, VARHDRSZ, xmlbinary, and XMLBINARY_BASE64.
Referenced by map_sql_typecoll_to_xmlschema_types().
|
static |
Definition at line 3854 of file xml.c.
References appendStringInfo(), StringInfoData::data, getBaseType(), i, initStringInfo(), lfirst, lfirst_oid, list_append_unique_oid(), map_sql_type_to_xmlschema_type(), TupleDescData::natts, NIL, and TupleDescAttr.
Referenced by database_to_xmlschema_internal(), map_sql_table_to_xmlschema(), and schema_to_xmlschema_internal().
Definition at line 2476 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(), str, timestamp2tm(), TIMESTAMP_NOT_FINITE, tm, pg_tm::tm_mday, pg_tm::tm_mon, pg_tm::tm_year, 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 2434 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().
|
static |
Definition at line 2784 of file xml.c.
References DatumGetObjectId(), elog, ERROR, i, lappend_oid(), sort-test::list, NIL, SPI_execute(), SPI_getbinval(), SPI_OK_SELECT, SPI_processed, SPI_result_code_string(), SPI_tuptable, SPITupleTable::tupdesc, and SPITupleTable::vals.
Referenced by database_get_xml_visible_schemas(), database_get_xml_visible_tables(), and schema_get_xml_visible_tables().
Datum query_to_xml | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2897 of file xml.c.
References PG_GETARG_BOOL, PG_GETARG_TEXT_PP, PG_RETURN_XML_P, query_to_xml_internal(), stringinfo_to_xmltype(), and text_to_cstring().
Datum query_to_xml_and_xmlschema | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3143 of file xml.c.
References _SPI_strdup(), elog, ERROR, InvalidOid, map_sql_table_to_xmlschema(), PG_GETARG_BOOL, PG_GETARG_TEXT_PP, PG_RETURN_XML_P, plan, query_to_xml_internal(), SPI_connect(), SPI_cursor_close(), SPI_cursor_open(), SPI_finish(), SPI_prepare(), stringinfo_to_xmltype(), text_to_cstring(), and PortalData::tupDesc.
|
static |
Definition at line 2999 of file xml.c.
References appendStringInfo(), appendStringInfoChar(), ereport, errcode(), errmsg(), ERROR, i, makeStringInfo(), map_sql_identifier_to_xml_name(), SPI_connect(), SPI_execute(), SPI_finish(), SPI_OK_SELECT, SPI_processed, SPI_sql_row_to_xmlelement(), xmldata_root_element_end(), and xmldata_root_element_start().
Referenced by query_to_xml(), query_to_xml_and_xmlschema(), and table_to_xml_internal().
Datum query_to_xmlschema | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3063 of file xml.c.
References _SPI_strdup(), cstring_to_xmltype(), elog, ERROR, InvalidOid, map_sql_table_to_xmlschema(), PG_GETARG_BOOL, PG_GETARG_TEXT_PP, PG_RETURN_XML_P, plan, SPI_connect(), SPI_cursor_close(), SPI_cursor_open(), SPI_finish(), SPI_prepare(), text_to_cstring(), and PortalData::tupDesc.
Definition at line 2813 of file xml.c.
References appendStringInfo(), CppAsString2, StringInfoData::data, initStringInfo(), nspid, and query_to_oid_list().
Referenced by schema_to_xml_internal(), and schema_to_xmlschema_internal().
Datum schema_to_xml | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3222 of file xml.c.
References LookupExplicitNamespace(), name, NameStr, nspid, PG_GETARG_BOOL, PG_GETARG_NAME, PG_GETARG_TEXT_PP, PG_RETURN_XML_P, schema_to_xml_internal(), stringinfo_to_xmltype(), and text_to_cstring().
Datum schema_to_xml_and_xmlschema | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3326 of file xml.c.
References StringInfoData::data, LookupExplicitNamespace(), name, NameStr, nspid, PG_GETARG_BOOL, PG_GETARG_NAME, PG_GETARG_TEXT_PP, PG_RETURN_XML_P, schema_to_xml_internal(), schema_to_xmlschema_internal(), stringinfo_to_xmltype(), and text_to_cstring().
|
static |
Definition at line 3179 of file xml.c.
References appendBinaryStringInfo(), appendStringInfo(), appendStringInfoChar(), StringInfoData::data, get_namespace_name(), StringInfoData::len, lfirst_oid, makeStringInfo(), map_sql_identifier_to_xml_name(), nspid, schema_get_xml_visible_tables(), SPI_connect(), SPI_finish(), table_to_xml_internal(), xmldata_root_element_end(), and xmldata_root_element_start().
Referenced by database_to_xml_internal(), schema_to_xml(), and schema_to_xml_and_xmlschema().
Datum schema_to_xmlschema | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3313 of file xml.c.
References name, NameStr, PG_GETARG_BOOL, PG_GETARG_NAME, PG_GETARG_TEXT_PP, PG_RETURN_XML_P, schema_to_xmlschema_internal(), stringinfo_to_xmltype(), and text_to_cstring().
|
static |
Definition at line 3268 of file xml.c.
References AccessShareLock, appendStringInfoString(), CreateTupleDescCopy(), lappend(), lfirst_oid, LookupExplicitNamespace(), makeStringInfo(), map_sql_schema_to_xmlschema_types(), map_sql_typecoll_to_xmlschema_types(), NIL, NoLock, nspid, RelationData::rd_att, schema_get_xml_visible_tables(), SPI_connect(), SPI_finish(), table_close(), table_open(), xsd_schema_element_end(), and xsd_schema_element_start().
Referenced by schema_to_xml_and_xmlschema(), and schema_to_xmlschema().
|
static |
Definition at line 4084 of file xml.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), i, map_sql_identifier_to_xml_name(), map_sql_value_to_xml_value(), TupleDescData::natts, SPI_fname(), SPI_getbinval(), SPI_gettypeid(), SPI_tuptable, SPITupleTable::tupdesc, SPITupleTable::vals, xmldata_root_element_end(), and xmldata_root_element_start().
Referenced by cursor_to_xml(), and query_to_xml_internal().
|
static |
Definition at line 467 of file xml.c.
References buf, and cstring_to_text_with_len().
Referenced by cursor_to_xml(), database_to_xml(), database_to_xml_and_xmlschema(), database_to_xmlschema(), query_to_xml(), query_to_xml_and_xmlschema(), schema_to_xml(), schema_to_xml_and_xmlschema(), schema_to_xmlschema(), table_to_xml(), table_to_xml_and_xmlschema(), xmlcomment(), xmlconcat(), xmlpi(), and xmlroot().
Datum table_to_xml | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2883 of file xml.c.
References PG_GETARG_BOOL, PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_XML_P, stringinfo_to_xmltype(), table_to_xml_internal(), and text_to_cstring().
Datum table_to_xml_and_xmlschema | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3122 of file xml.c.
References AccessShareLock, map_sql_table_to_xmlschema(), NoLock, PG_GETARG_BOOL, PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_XML_P, RelationData::rd_att, stringinfo_to_xmltype(), table_close(), table_open(), table_to_xml_internal(), and text_to_cstring().
|
static |
Definition at line 2866 of file xml.c.
References appendStringInfo(), StringInfoData::data, DatumGetCString(), DirectFunctionCall1, get_rel_name(), initStringInfo(), ObjectIdGetDatum(), query_to_xml_internal(), and regclassout().
Referenced by schema_to_xml_internal(), table_to_xml(), and table_to_xml_and_xmlschema().
Datum table_to_xmlschema | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3044 of file xml.c.
References AccessShareLock, cstring_to_xmltype(), map_sql_table_to_xmlschema(), NoLock, PG_GETARG_BOOL, PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_XML_P, RelationData::rd_att, table_close(), table_open(), and text_to_cstring().
Datum texttoxml | ( | PG_FUNCTION_ARGS | ) |
Definition at line 637 of file xml.c.
References data, PG_GETARG_TEXT_PP, PG_RETURN_XML_P, xmloption, and xmlparse().
Datum xml_in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 273 of file xml.c.
References cstring_to_text(), GetDatabaseEncoding(), NO_XML_SUPPORT, PG_GETARG_CSTRING, PG_RETURN_XML_P, and xmloption.
bool xml_is_document | ( | xmltype * | arg | ) |
Definition at line 1117 of file xml.c.
References arg, ErrorSaveContext::error_occurred, GetDatabaseEncoding(), NO_XML_SUPPORT, and XMLOPTION_DOCUMENT.
Referenced by ExecEvalXmlExpr().
Datum xml_is_well_formed | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4607 of file xml.c.
References data, NO_XML_SUPPORT, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and xmloption.
Datum xml_is_well_formed_content | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4633 of file xml.c.
References data, NO_XML_SUPPORT, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and XMLOPTION_CONTENT.
Datum xml_is_well_formed_document | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4620 of file xml.c.
References data, NO_XML_SUPPORT, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and XMLOPTION_DOCUMENT.
Datum xml_out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 356 of file xml.c.
References PG_GETARG_XML_P, PG_RETURN_CSTRING, x, and xml_out_internal().
Definition at line 312 of file xml.c.
References appendStringInfoString(), buf, ereport, errcode(), ERRCODE_DATA_CORRUPTED, errmsg_internal(), initStringInfo(), len, pfree(), str, text_to_cstring(), WARNING, and x.
Referenced by xml_out(), xml_send(), and XmlTableSetDocument().
Datum xml_recv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 371 of file xml.c.
References buf, cstring_to_text(), encoding, NO_XML_SUPPORT, palloc(), pfree(), pg_any_to_server(), PG_GETARG_POINTER, PG_RETURN_XML_P, PG_UTF8, pq_getmsgbytes(), SET_VARSIZE, str, VARDATA, VARHDRSZ, and xmloption.
Datum xml_send | ( | PG_FUNCTION_ARGS | ) |
Definition at line 438 of file xml.c.
References buf, pfree(), pg_get_client_encoding(), PG_GETARG_XML_P, PG_RETURN_BYTEA_P, pq_begintypsend(), pq_endtypsend(), pq_sendtext(), x, and xml_out_internal().
Datum xmlcomment | ( | PG_FUNCTION_ARGS | ) |
Definition at line 491 of file xml.c.
References appendStringInfoString(), appendStringInfoText(), arg, buf, ereport, errcode(), errmsg(), ERROR, i, initStringInfo(), len, NO_XML_SUPPORT, PG_GETARG_TEXT_PP, PG_RETURN_XML_P, stringinfo_to_xmltype(), VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Definition at line 553 of file xml.c.
References appendBinaryStringInfo(), appendStringInfoString(), generate_unaccent_rules::args, buf, DatumGetXmlP(), initStringInfo(), len, lfirst, NO_XML_SUPPORT, pfree(), PointerGetDatum(), str, stringinfo_to_xmltype(), text_to_cstring(), VARHDRSZ, VARSIZE, and x.
Referenced by ExecEvalXmlExpr(), and xmlconcat2().
Datum xmlconcat2 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 619 of file xml.c.
References list_make2, PG_ARGISNULL, PG_GETARG_XML_P, PG_RETURN_NULL, PG_RETURN_XML_P, and xmlconcat().
|
static |
Definition at line 2992 of file xml.c.
References appendStringInfo().
Referenced by cursor_to_xml(), database_to_xml_internal(), query_to_xml_internal(), schema_to_xml_internal(), and SPI_sql_row_to_xmlelement().
|
static |
Definition at line 2965 of file xml.c.
References appendStringInfo(), appendStringInfoString(), Assert, and NAMESPACE_XSI.
Referenced by cursor_to_xml(), database_to_xml_internal(), query_to_xml_internal(), schema_to_xml_internal(), and SPI_sql_row_to_xmlelement().
xmltype* xmlelement | ( | XmlExpr * | xexpr, |
Datum * | named_argvalue, | ||
bool * | named_argnull, | ||
Datum * | argvalue, | ||
bool * | argnull | ||
) |
Definition at line 857 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, str, strVal, and xml_ereport().
Referenced by ExecEvalXmlExpr().
Datum xmlexists | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4542 of file xml.c.
References data, NO_XML_SUPPORT, PG_GETARG_TEXT_PP, PG_GETARG_XML_P, and PG_RETURN_BOOL.
xmltype* xmlparse | ( | text * | data, |
XmlOptionType | xmloption_arg, | ||
bool | preserve_whitespace | ||
) |
Definition at line 981 of file xml.c.
References data, GetDatabaseEncoding(), and NO_XML_SUPPORT.
Referenced by ExecEvalXmlExpr(), and texttoxml().
Definition at line 999 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 1051 of file xml.c.
References appendStringInfoString(), buf, data, initStringInfo(), len, NO_XML_SUPPORT, 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().
|
static |
Definition at line 5077 of file xml.c.
References i, NO_XML_SUPPORT, and pg_xml_done().
|
static |
|
static |
Definition at line 4925 of file xml.c.
References appendStringInfoText(), Assert, cur, elog, ereport, errcode(), errmsg(), ERROR, escape_xml(), get_type_category_preferred(), i, initStringInfo(), InputFunctionCall(), NO_XML_SUPPORT, PG_END_TRY, PG_FINALLY, PG_TRY, str, and xml_ereport().
|
static |
Definition at line 4682 of file xml.c.
References ERROR, NO_XML_SUPPORT, palloc0(), PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, pg_xml_done(), pg_xml_init(), PG_XML_STRICTNESS_ALL, and xml_ereport().
|
static |
Definition at line 4845 of file xml.c.
References Assert, ereport, errcode(), errmsg(), ERROR, NO_XML_SUPPORT, PointerIsValid, and xml_ereport().
|
static |
Definition at line 4730 of file xml.c.
References DatumGetXmlP(), ERROR, NO_XML_SUPPORT, PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, str, value, xml_ereport(), and xml_out_internal().
|
static |
Definition at line 4787 of file xml.c.
References ereport, errcode(), errmsg(), ERROR, name, NO_XML_SUPPORT, and xml_ereport().
|
static |
Definition at line 4813 of file xml.c.
References Assert, ereport, errcode(), errmsg(), ERROR, NO_XML_SUPPORT, and xml_ereport().
Datum xmltext | ( | PG_FUNCTION_ARGS | ) |
Definition at line 527 of file xml.c.
References arg, Assert, cstring_to_text_with_len(), NO_XML_SUPPORT, PG_GETARG_TEXT_PP, and PG_RETURN_XML_P.
Datum xmltotext | ( | PG_FUNCTION_ARGS | ) |
text* xmltotext_with_options | ( | xmltype * | data, |
XmlOptionType | xmloption_arg, | ||
bool | indent | ||
) |
Definition at line 656 of file xml.c.
References buf, cstring_to_text_with_len(), data, ereport, errcode(), errmsg(), ERROR, ErrorSaveContext::error_occurred, GetDatabaseEncoding(), len, newline, NO_XML_SUPPORT, PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, pg_xml_done(), pg_xml_init(), PG_XML_STRICTNESS_ALL, root, str, xml_ereport(), and XMLOPTION_DOCUMENT.
Referenced by ExecEvalXmlExpr().
Datum xmlvalidate | ( | PG_FUNCTION_ARGS | ) |
Datum xpath | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4519 of file xml.c.
References CurrentMemoryContext, data, initArrayResult(), makeArrayResult(), NO_XML_SUPPORT, PG_GETARG_ARRAYTYPE_P, PG_GETARG_TEXT_PP, PG_GETARG_XML_P, and PG_RETURN_DATUM.
Referenced by pgxml_xpath(), xpath_bool(), xpath_list(), xpath_nodeset(), xpath_number(), and xpath_string().
Datum xpath_exists | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4565 of file xml.c.
References data, NO_XML_SUPPORT, PG_GETARG_ARRAYTYPE_P, PG_GETARG_TEXT_PP, PG_GETARG_XML_P, and PG_RETURN_BOOL.
|
static |
Definition at line 3261 of file xml.c.
References appendStringInfoString().
Referenced by database_to_xmlschema_internal(), map_sql_table_to_xmlschema(), and schema_to_xmlschema_internal().
|
static |
Definition at line 3244 of file xml.c.
References appendStringInfo(), appendStringInfoString(), and NAMESPACE_XSD.
Referenced by database_to_xmlschema_internal(), map_sql_table_to_xmlschema(), and schema_to_xmlschema_internal().
int xmlbinary = XMLBINARY_BASE64 |
Definition at line 109 of file xml.c.
Referenced by map_sql_type_to_xmlschema_type(), and map_sql_value_to_xml_value().
int xmloption = XMLOPTION_CONTENT |
Definition at line 110 of file xml.c.
Referenced by texttoxml(), xml_in(), xml_is_well_formed(), and xml_recv().
const TableFuncRoutine XmlTableRoutine |
Definition at line 223 of file xml.c.
Referenced by ExecInitTableFuncScan().