20#include <libxml/xpath.h>
21#include <libxml/tree.h>
22#include <libxml/xmlmemory.h>
23#include <libxml/xmlerror.h>
24#include <libxml/parserInternals.h>
107 "could not allocate xmlChar");
161 "could not allocate xmlBuffer");
215 "could not allocate result");
402 volatile bool isNull =
false;
447 volatile int bRes = 0;
507 "XPath Syntax Error");
563 "could not allocate result");
567 elog(
NOTICE,
"unsupported XQuery result: %d", res->type);
571 "could not allocate result");
640 if (
rsinfo->setDesc->natts < 1)
643 errmsg(
"xpath_table must have at least one output column")));
691 elog(
ERROR,
"xpath_table: SPI execution failed for query %s",
706 errmsg(
"expression returning multiple columns is not valid in parameter list"),
721 for (
i = 0;
i < proc;
i++)
741 for (
j = 0;
j <
rsinfo->setDesc->natts;
j++)
777 "could not allocate XPath context");
786 "XPath Syntax Error");
798 if (res->nodesetval !=
NULL &&
805 "could not allocate result");
818 "could not allocate result");
822 elog(
NOTICE,
"unsupported XQuery result: %d", res->type);
827 "could not allocate result");
static Datum values[MAXATTR]
int errcode(int sqlerrcode)
int errdetail(const char *fmt,...) pg_attribute_printf(1
#define ereport(elevel,...)
HeapTuple BuildTupleFromCStrings(AttInMetadata *attinmeta, char **values)
AttInMetadata * TupleDescGetAttInMetadata(TupleDesc tupdesc)
#define palloc0_object(type)
#define PG_GETARG_TEXT_PP(n)
#define PG_MODULE_MAGIC_EXT(...)
#define PG_FUNCTION_INFO_V1(funcname)
#define PG_RETURN_TEXT_P(x)
#define PG_RETURN_FLOAT4(x)
#define PG_RETURN_BOOL(x)
void InitMaterializedSRF(FunctionCallInfo fcinfo, bits32 flags)
#define MAT_SRF_USE_EXPECTED_DESC
void heap_freetuple(HeapTuple htup)
void pfree(void *pointer)
static char buf[DEFAULT_XLOG_SEG_SIZE]
SPITupleTable * SPI_tuptable
int SPI_exec(const char *src, long tcount)
char * SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber)
void appendStringInfo(StringInfo str, const char *fmt,...)
void initStringInfo(StringInfo str)
void tuplestore_puttuple(Tuplestorestate *state, HeapTuple tuple)
static Size VARSIZE_ANY_EXHDR(const void *PTR)
static char * VARDATA_ANY(const void *PTR)
text * cstring_to_text(const char *s)
char * text_to_cstring(const text *t)
Datum xpath(PG_FUNCTION_ARGS)
struct PgXmlErrorContext PgXmlErrorContext
PgXmlErrorContext * pg_xml_init(PgXmlStrictness strictness)
void xml_ereport(PgXmlErrorContext *errcxt, int level, int sqlcode, const char *msg)
bool pg_xml_error_occurred(PgXmlErrorContext *errcxt)
void pg_xml_done(PgXmlErrorContext *errcxt, bool isError)
@ PG_XML_STRICTNESS_LEGACY
static text * pgxml_result_to_text(xmlXPathObjectPtr res, xmlChar *toptag, xmlChar *septag, xmlChar *plainsep)
Datum xpath_bool(PG_FUNCTION_ARGS)
Datum xpath_number(PG_FUNCTION_ARGS)
Datum xpath_table(PG_FUNCTION_ARGS)
static xmlChar * pgxml_texttoxmlchar(text *textstring)
PgXmlErrorContext * pgxml_parser_init(PgXmlStrictness strictness)
Datum xpath_string(PG_FUNCTION_ARGS)
static void cleanup_workspace(xpath_workspace *workspace)
Datum xml_encode_special_chars(PG_FUNCTION_ARGS)
Datum xpath_list(PG_FUNCTION_ARGS)
static xmlChar * pgxmlNodeSetToText(xmlNodeSetPtr nodeset, xmlChar *toptagname, xmlChar *septagname, xmlChar *plainsep)
static xpath_workspace * pgxml_xpath(text *document, xmlChar *xpath, PgXmlErrorContext *xmlerrcxt)
Datum xpath_nodeset(PG_FUNCTION_ARGS)