diff options
author | Neil Conway | 2004-03-07 20:41:27 +0000 |
---|---|---|
committer | Neil Conway | 2004-03-07 20:41:27 +0000 |
commit | 8e4b6f3812419fa78489fb1db3d6c4054dd78aff (patch) | |
tree | ff8c9eb6df6b63d8aea28f51d8d9c1a71c5aa7ac | |
parent | 454ab8f1d411cb1028185e20165bc199b9919adb (diff) |
contrib/xml2 updates from John Gray:
I have changed the name of the new parse function to xml_valid and fixed
a reference to SortMem which meant that the code as supplied would work
against 7.3 and 7.4 but wouldn't work in CVS.
-rw-r--r-- | contrib/xml2/README.pgxml | 2 | ||||
-rw-r--r-- | contrib/xml2/pgxml.sql.in | 2 | ||||
-rw-r--r-- | contrib/xml2/xpath.c | 14 |
3 files changed, 9 insertions, 9 deletions
diff --git a/contrib/xml2/README.pgxml b/contrib/xml2/README.pgxml index f29d071722..88bc1c683f 100644 --- a/contrib/xml2/README.pgxml +++ b/contrib/xml2/README.pgxml @@ -27,7 +27,7 @@ Description of functions The first set of functions are straightforward XML parsing and XPath queries: -pgxml_parse(document) RETURNS bool +xml_valid(document) RETURNS bool This parses the document text in its parameter and returns true if the document is well-formed XML. diff --git a/contrib/xml2/pgxml.sql.in b/contrib/xml2/pgxml.sql.in index ff46e845b1..9951d6c046 100644 --- a/contrib/xml2/pgxml.sql.in +++ b/contrib/xml2/pgxml.sql.in @@ -1,6 +1,6 @@ --SQL for XML parser -CREATE OR REPLACE FUNCTION pgxml_parse(text) RETURNS bool +CREATE OR REPLACE FUNCTION xml_valid(text) RETURNS bool AS 'MODULE_PATHNAME' LANGUAGE 'c' WITH (isStrict); CREATE OR REPLACE FUNCTION xpath_string(text,text) RETURNS text diff --git a/contrib/xml2/xpath.c b/contrib/xml2/xpath.c index b4fc828798..84792ca248 100644 --- a/contrib/xml2/xpath.c +++ b/contrib/xml2/xpath.c @@ -39,7 +39,7 @@ xmlChar *pgxml_texttoxmlchar(text *textstring); static xmlXPathObjectPtr pgxml_xpath(text *document, xmlChar* xpath); -Datum pgxml_parse(PG_FUNCTION_ARGS); +Datum xml_valid(PG_FUNCTION_ARGS); Datum xpath_nodeset(PG_FUNCTION_ARGS); Datum xpath_string(PG_FUNCTION_ARGS); Datum xpath_number(PG_FUNCTION_ARGS); @@ -162,12 +162,12 @@ pgxml_parser_init() /* Returns true if document is well-formed */ -PG_FUNCTION_INFO_V1(pgxml_parse); +PG_FUNCTION_INFO_V1(xml_valid); Datum -pgxml_parse(PG_FUNCTION_ARGS) +xml_valid(PG_FUNCTION_ARGS) { - /* called as pgxml_parse(document) */ + /* called as xml_valid(document) */ xmlDocPtr doctree; text *t = PG_GETARG_TEXT_P(0); /* document buffer */ int32 docsize = VARSIZE(t) - VARHDRSZ; @@ -646,11 +646,11 @@ Datum xpath_table(PG_FUNCTION_ARGS) per_query_ctx = rsinfo->econtext->ecxt_per_query_memory; oldcontext = MemoryContextSwitchTo(per_query_ctx); -/* Create the tuplestore - SortMem is the max in-memory size before it is - * shipped to a disk heap file. Just like ... SortMem! +/* Create the tuplestore - work_mem is the max in-memory size before a + * file is created on disk to hold it. */ - tupstore = tuplestore_begin_heap(true, false, SortMem); + tupstore = tuplestore_begin_heap(true, false, work_mem); MemoryContextSwitchTo(oldcontext); |