19#include <libxml/xpath.h>
20#include <libxml/tree.h>
21#include <libxml/xmlmemory.h>
22#include <libxml/xmlerror.h>
23#include <libxml/parserInternals.h>
106 "could not allocate xmlChar");
160 "could not allocate xmlBuffer");
214 "could not allocate result");
401 volatile bool isNull =
false;
446 volatile int bRes = 0;
506 "XPath Syntax Error");
562 "could not allocate result");
566 elog(
NOTICE,
"unsupported XQuery result: %d", res->type);
570 "could not allocate result");
639 if (
rsinfo->setDesc->natts < 1)
642 errmsg(
"xpath_table must have at least one output column")));
690 elog(
ERROR,
"xpath_table: SPI execution failed for query %s",
705 errmsg(
"expression returning multiple columns is not valid in parameter list"),
720 for (
i = 0;
i < proc;
i++)
740 for (
j = 0;
j <
rsinfo->setDesc->natts;
j++)
776 "could not allocate XPath context");
785 "XPath Syntax Error");
797 if (res->nodesetval !=
NULL &&
804 "could not allocate result");
817 "could not allocate result");
821 elog(
NOTICE,
"unsupported XQuery result: %d", res->type);
826 "could not allocate result");
static Datum values[MAXATTR]
int errdetail(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#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)