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/nodeFuncs.h"
#include "utils/array.h"
#include "utils/builtins.h"
#include "utils/date.h"
#include "utils/datetime.h"
#include "utils/lsyscache.h"
#include "utils/memutils.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 |
int | xmloption |
const TableFuncRoutine | XmlTableRoutine |
#define NAMESPACE_SQLXML "http://standards.iso.org/iso/9075/2003/sqlxml" |
#define NAMESPACE_XSD "http://www.w3.org/2001/XMLSchema" |
Definition at line 228 of file xml.c.
Referenced by xsd_schema_element_start().
#define NAMESPACE_XSI "http://www.w3.org/2001/XMLSchema-instance" |
Definition at line 229 of file xml.c.
Referenced by xmldata_root_element_start().
#define NO_XML_SUPPORT | ( | ) |
Definition at line 219 of file xml.c.
Referenced by map_sql_identifier_to_xml_name(), xml_in(), xml_is_document(), xml_is_well_formed(), xml_is_well_formed_content(), xml_is_well_formed_document(), xml_recv(), xmlcomment(), xmlconcat(), xmlelement(), xmlexists(), xmlparse(), xmlpi(), xmlroot(), XmlTableDestroyOpaque(), XmlTableFetchRow(), XmlTableGetValue(), XmlTableInitOpaque(), XmlTableSetColumnFilter(), XmlTableSetDocument(), XmlTableSetNamespace(), XmlTableSetRowFilter(), xpath(), and xpath_exists().
#define PG_XML_DEFAULT_VERSION "1.0" |
Definition at line 282 of file xml.c.
Referenced by xml_is_document().
#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 |
Definition at line 2494 of file xml.c.
Referenced by database_get_xml_visible_schemas(), and database_get_xml_visible_tables().
#define XML_VISIBLE_SCHEMAS_EXCLUDE "(nspname ~ '^pg_' OR nspname = 'information_schema')" |
|
static |
Definition at line 2385 of file xml.c.
References SPI_palloc().
Referenced by cursor_to_xmlschema(), query_to_xml_and_xmlschema(), and query_to_xmlschema().
|
static |
Definition at line 454 of file xml.c.
References cstring_to_text(), and cstring_to_text_with_len().
Referenced by cursor_to_xmlschema(), query_to_xmlschema(), SPI_sql_row_to_xmlelement(), and table_to_xmlschema().
Datum cursor_to_xml | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2569 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 2750 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 2498 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 2505 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 3051 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 3118 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 3008 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, 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 3106 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 3063 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 2353 of file xml.c.
References appendStringInfoCharMacro, appendStringInfoString(), buf, StringInfoData::data, and initStringInfo().
Referenced by ExplainProperty(), ExplainPropertyList(), map_sql_value_to_xml_value(), SPI_sql_row_to_xmlelement(), and XmlTableGetValue().
|
static |
Definition at line 3137 of file xml.c.
References appendStringInfo(), appendStringInfoString(), 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 3346 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(), and MyDatabaseId.
Referenced by database_to_xmlschema_internal().
Definition at line 2036 of file xml.c.
References appendBinaryStringInfo(), appendStringInfo(), appendStringInfoString(), Assert, buf, StringInfoData::data, 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 3273 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, and relname.
Referenced by schema_to_xmlschema_internal().
|
static |
Definition at line 3168 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(), RELOID, 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 3403 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(), TYPEOID, and VARHDRSZ.
Referenced by map_sql_table_to_xmlschema(), and map_sql_type_to_xmlschema_type().
|
static |
Definition at line 3563 of file xml.c.
References appendStringInfo(), appendStringInfoString(), StringInfoData::data, get_typtype(), getBaseTypeAndTypmod(), initStringInfo(), INT64_FORMAT, map_sql_type_to_xml_name(), VARHDRSZ, xmlbinary, and XMLBINARY_BASE64.
Referenced by map_sql_typecoll_to_xmlschema_types().
|
static |
Definition at line 3508 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 2134 of file xml.c.
References appendStringInfoString(), ARR_ELEMTYPE, buf, StringInfoData::data, 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(), map_sql_value_to_xml_value(), 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, pg_tm::tm_mday, pg_tm::tm_mon, pg_tm::tm_year, type_is_array_domain, USE_XSD_DATES, VARDATA_ANY, VARSIZE_ANY_EXHDR, xml_ereport(), xmlbinary, and XMLBINARY_BASE64.
Referenced by ExecEvalXmlExpr(), map_sql_value_to_xml_value(), SPI_sql_row_to_xmlelement(), and xmlelement().
char* map_xml_name_to_sql_identifier | ( | const char * | name | ) |
Definition at line 2092 of file xml.c.
References appendBinaryStringInfo(), appendStringInfoString(), buf, StringInfoData::data, initStringInfo(), MAX_UNICODE_EQUIVALENT_STRING, pg_mblen(), and pg_unicode_to_server().
Referenced by get_rule_expr().
|
static |
Definition at line 2442 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 2555 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 2797 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, 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 2657 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 2721 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, SPI_connect(), SPI_cursor_close(), SPI_cursor_open(), SPI_finish(), SPI_prepare(), text_to_cstring(), and PortalData::tupDesc.
Definition at line 2471 of file xml.c.
References appendStringInfo(), CppAsString2, StringInfoData::data, initStringInfo(), 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 2876 of file xml.c.
References LookupExplicitNamespace(), name, NameStr, 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 2980 of file xml.c.
References StringInfoData::data, LookupExplicitNamespace(), name, NameStr, 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 2833 of file xml.c.
References appendBinaryStringInfo(), appendStringInfo(), appendStringInfoChar(), StringInfoData::data, get_namespace_name(), StringInfoData::len, lfirst_oid, makeStringInfo(), map_sql_identifier_to_xml_name(), 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 2967 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 2922 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, 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 3738 of file xml.c.
References accumArrayResult(), appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), ARR_DIMS, ARR_ELEMTYPE, ARR_NDIM, Assert, BoolGetDatum, generate_unaccent_rules::bytes(), cstring_to_text(), cstring_to_xmltype(), CStringGetDatum, cur, CurrentMemoryContext, deconstruct_array(), elog, ereport, errcode(), errdetail(), errmsg(), ERROR, escape_xml(), Float8GetDatum(), GetDatabaseEncoding(), i, map_sql_identifier_to_xml_name(), map_sql_value_to_xml_value(), TupleDescData::natts, pfree(), PG_CATCH, PG_END_TRY, PG_FINALLY, PG_RE_THROW, PG_TRY, PG_UTF8, pg_xml_done(), pg_xml_init(), PG_XML_STRICTNESS_ALL, PointerGetDatum, SPI_fname(), SPI_getbinval(), SPI_gettypeid(), SPI_tuptable, generate_unaccent_rules::str, TextDatumGetCString, SPITupleTable::tupdesc, SPITupleTable::vals, VARDATA, VARDATA_ANY, VARHDRSZ, VARSIZE, VARSIZE_ANY_EXHDR, xml_ereport(), xmldata_root_element_end(), and xmldata_root_element_start().
Referenced by cursor_to_xml(), and query_to_xml_internal().
|
static |
Definition at line 447 of file xml.c.
References cstring_to_text_with_len(), StringInfoData::data, and StringInfoData::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 2541 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 2776 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 2524 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 2702 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 596 of file xml.c.
References PG_GETARG_TEXT_PP, PG_RETURN_XML_P, xmloption, and xmlparse().
Datum xml_in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 258 of file xml.c.
References cstring_to_text(), GetDatabaseEncoding(), NO_XML_SUPPORT, PG_GETARG_CSTRING, PG_RETURN_XML_P, and xmloption.
Definition at line 888 of file xml.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, appendBinaryStringInfo(), appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), Assert, CopyErrorData(), CurrentMemoryContext, StringInfoData::data, elog, encoding, ereport, errcode(), errdetail(), errdetail_internal(), errhint(), errmsg(), errmsg_internal(), ERROR, error(), FATAL, FlushErrorState(), GetDatabaseEncoding(), gettext_noop, initStringInfo(), StringInfoData::len, makeStringInfo(), MAX_MULTIBYTE_CHAR_LEN, MemoryContextAlloc(), MemoryContextStrdup(), MemoryContextSwitchTo(), name, NO_XML_SUPPORT, NOTICE, palloc(), pfree(), PG_CATCH, pg_do_encoding_conversion(), pg_encoding_mb2wchar_with_len(), pg_encoding_mblen(), pg_encoding_to_char(), PG_END_TRY, PG_FINALLY, pg_mblen(), PG_RE_THROW, pg_server_to_any(), PG_TRY, PG_UTF8, PG_XML_DEFAULT_VERSION, pg_xml_done(), pg_xml_error_occurred(), pg_xml_init(), pg_xml_init_library(), PG_XML_STRICTNESS_LEGACY, PG_XML_STRICTNESS_WELLFORMED, pstrdup(), repalloc(), ErrorData::sqlerrcode, generate_unaccent_rules::str, strnlen(), text_to_cstring(), TopMemoryContext, VARSIZE_ANY_EXHDR, WARNING, xml_ereport(), and XMLOPTION_DOCUMENT.
Referenced by ExecEvalXmlExpr(), and xmltotext_with_xmloption().
Datum xml_is_well_formed | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4263 of file xml.c.
References NO_XML_SUPPORT, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and xmloption.
Datum xml_is_well_formed_content | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4289 of file xml.c.
References elog, ERROR, IsA, NO_XML_SUPPORT, TableFuncScanState::opaque, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and XMLOPTION_CONTENT.
Datum xml_is_well_formed_document | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4276 of file xml.c.
References NO_XML_SUPPORT, PG_GETARG_TEXT_PP, PG_RETURN_BOOL, and XMLOPTION_DOCUMENT.
Datum xml_out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 336 of file xml.c.
References PG_GETARG_XML_P, PG_RETURN_CSTRING, and xml_out_internal().
Definition at line 293 of file xml.c.
References appendStringInfoString(), buf, StringInfoData::data, initStringInfo(), pfree(), generate_unaccent_rules::str, text_to_cstring(), and WARNING.
Referenced by xml_out(), xml_send(), and XmlTableSetDocument().
Datum xml_recv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 351 of file xml.c.
References cstring_to_text(), StringInfoData::cursor, encoding, StringInfoData::len, NO_XML_SUPPORT, palloc(), pfree(), pg_any_to_server(), PG_GETARG_POINTER, PG_RETURN_XML_P, PG_UTF8, pq_getmsgbytes(), SET_VARSIZE, generate_unaccent_rules::str, VARDATA, VARHDRSZ, and xmloption.
Datum xml_send | ( | PG_FUNCTION_ARGS | ) |
Definition at line 418 of file xml.c.
References appendBinaryStringInfo(), appendStringInfoText(), buf, pfree(), pg_get_client_encoding(), PG_GETARG_XML_P, PG_RETURN_BYTEA_P, pq_begintypsend(), pq_endtypsend(), pq_sendtext(), VARDATA_ANY, VARSIZE_ANY_EXHDR, and xml_out_internal().
Datum xmlcomment | ( | PG_FUNCTION_ARGS | ) |
Definition at line 471 of file xml.c.
References appendStringInfoString(), appendStringInfoText(), arg, buf, ereport, errcode(), errmsg(), ERROR, i, initStringInfo(), NO_XML_SUPPORT, PG_GETARG_TEXT_PP, PG_RETURN_XML_P, stringinfo_to_xmltype(), VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Definition at line 512 of file xml.c.
References appendBinaryStringInfo(), appendStringInfoString(), buf, StringInfoData::data, DatumGetXmlP, initStringInfo(), StringInfoData::len, lfirst, NO_XML_SUPPORT, pfree(), PointerGetDatum, generate_unaccent_rules::str, stringinfo_to_xmltype(), text_to_cstring(), VARHDRSZ, and VARSIZE.
Referenced by ExecEvalXmlExpr(), and xmlconcat2().
Datum xmlconcat2 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 578 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 2650 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 2623 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 628 of file xml.c.
References arg, XmlExpr::arg_names, XmlExpr::args, ERROR, exprType(), forboth, i, lappend(), lfirst, map_sql_value_to_xml_value(), XmlExpr::name, 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().
Datum xmlexists | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4190 of file xml.c.
References 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 752 of file xml.c.
References GetDatabaseEncoding(), and NO_XML_SUPPORT.
Referenced by ExecEvalXmlExpr(), and texttoxml().
Definition at line 770 of file xml.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), buf, StringInfoData::data, 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 822 of file xml.c.
References appendStringInfoString(), buf, initStringInfo(), 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().
|
static |
Definition at line 4727 of file xml.c.
References i, NO_XML_SUPPORT, TableFuncScanState::opaque, and pg_xml_done().
|
static |
Definition at line 4530 of file xml.c.
References ERROR, NO_XML_SUPPORT, and xml_ereport().
|
static |
Definition at line 4575 of file xml.c.
References appendStringInfoText(), Assert, cur, StringInfoData::data, elog, ereport, errcode(), errmsg(), ERROR, escape_xml(), get_type_category_preferred(), i, TableFuncScanState::in_functions, initStringInfo(), InputFunctionCall(), NO_XML_SUPPORT, PG_END_TRY, PG_FINALLY, PG_TRY, generate_unaccent_rules::str, TableFuncScanState::typioparams, and xml_ereport().
|
static |
Definition at line 4338 of file xml.c.
References ERROR, NO_XML_SUPPORT, TableFuncScanState::opaque, 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 4498 of file xml.c.
References AssertArg, ereport, errcode(), errmsg(), ERROR, NO_XML_SUPPORT, PointerIsValid, and xml_ereport().
|
static |
Definition at line 4386 of file xml.c.
References DatumGetXmlP, ERROR, NO_XML_SUPPORT, PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, generate_unaccent_rules::str, xml_ereport(), and xml_out_internal().
|
static |
Definition at line 4443 of file xml.c.
References ereport, errcode(), errmsg(), ERROR, NO_XML_SUPPORT, and xml_ereport().
|
static |
Definition at line 4469 of file xml.c.
References ereport, errcode(), errmsg(), ERROR, NO_XML_SUPPORT, and xml_ereport().
Datum xmltotext | ( | PG_FUNCTION_ARGS | ) |
text* xmltotext_with_xmloption | ( | xmltype * | data, |
XmlOptionType | xmloption_arg | ||
) |
Definition at line 615 of file xml.c.
References ereport, errcode(), errmsg(), ERROR, xml_is_document(), and XMLOPTION_DOCUMENT.
Referenced by ExecEvalXmlExpr().
Datum xmlvalidate | ( | PG_FUNCTION_ARGS | ) |
Datum xpath | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4167 of file xml.c.
References CurrentMemoryContext, initArrayResult(), makeArrayResult(), NO_XML_SUPPORT, PG_GETARG_ARRAYTYPE_P, PG_GETARG_TEXT_PP, PG_GETARG_XML_P, and PG_RETURN_ARRAYTYPE_P.
Referenced by xpath_bool(), xpath_list(), xpath_nodeset(), xpath_number(), and xpath_string().
Datum xpath_exists | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4213 of file xml.c.
References FlushErrorState(), GetDatabaseEncoding(), NO_XML_SUPPORT, PG_CATCH, PG_END_TRY, PG_GETARG_ARRAYTYPE_P, PG_GETARG_TEXT_PP, PG_GETARG_XML_P, PG_RETURN_BOOL, and PG_TRY.
|
static |
Definition at line 2915 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 2898 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 |
Definition at line 97 of file xml.c.
Referenced by map_sql_type_to_xmlschema_type(), and map_sql_value_to_xml_value().
int xmloption |
Definition at line 98 of file xml.c.
Referenced by _copyXmlExpr(), _copyXmlSerialize(), _equalXmlExpr(), _equalXmlSerialize(), _outXmlExpr(), _outXmlSerialize(), _readXmlExpr(), texttoxml(), xml_in(), xml_is_well_formed(), and xml_recv().
const TableFuncRoutine XmlTableRoutine |
Definition at line 207 of file xml.c.
Referenced by ExecInitTableFuncScan().