Skip to content

Commit bab4269

Browse files
author
Neil Conway
committed
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.
1 parent 9e5a091 commit bab4269

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

contrib/xml2/README.pgxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Description of functions
2727

2828
The first set of functions are straightforward XML parsing and XPath queries:
2929

30-
pgxml_parse(document) RETURNS bool
30+
xml_valid(document) RETURNS bool
3131

3232
This parses the document text in its parameter and returns true if the
3333
document is well-formed XML.

contrib/xml2/pgxml.sql.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--SQL for XML parser
22

3-
CREATE OR REPLACE FUNCTION pgxml_parse(text) RETURNS bool
3+
CREATE OR REPLACE FUNCTION xml_valid(text) RETURNS bool
44
AS 'MODULE_PATHNAME' LANGUAGE 'c' WITH (isStrict);
55

66
CREATE OR REPLACE FUNCTION xpath_string(text,text) RETURNS text

contrib/xml2/xpath.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ xmlChar *pgxml_texttoxmlchar(text *textstring);
3939
static xmlXPathObjectPtr pgxml_xpath(text *document, xmlChar* xpath);
4040

4141

42-
Datum pgxml_parse(PG_FUNCTION_ARGS);
42+
Datum xml_valid(PG_FUNCTION_ARGS);
4343
Datum xpath_nodeset(PG_FUNCTION_ARGS);
4444
Datum xpath_string(PG_FUNCTION_ARGS);
4545
Datum xpath_number(PG_FUNCTION_ARGS);
@@ -162,12 +162,12 @@ pgxml_parser_init()
162162

163163
/* Returns true if document is well-formed */
164164

165-
PG_FUNCTION_INFO_V1(pgxml_parse);
165+
PG_FUNCTION_INFO_V1(xml_valid);
166166

167167
Datum
168-
pgxml_parse(PG_FUNCTION_ARGS)
168+
xml_valid(PG_FUNCTION_ARGS)
169169
{
170-
/* called as pgxml_parse(document) */
170+
/* called as xml_valid(document) */
171171
xmlDocPtr doctree;
172172
text *t = PG_GETARG_TEXT_P(0); /* document buffer */
173173
int32 docsize = VARSIZE(t) - VARHDRSZ;
@@ -646,11 +646,11 @@ Datum xpath_table(PG_FUNCTION_ARGS)
646646
per_query_ctx = rsinfo->econtext->ecxt_per_query_memory;
647647
oldcontext = MemoryContextSwitchTo(per_query_ctx);
648648

649-
/* Create the tuplestore - SortMem is the max in-memory size before it is
650-
* shipped to a disk heap file. Just like ... SortMem!
649+
/* Create the tuplestore - work_mem is the max in-memory size before a
650+
* file is created on disk to hold it.
651651
*/
652652

653-
tupstore = tuplestore_begin_heap(true, false, SortMem);
653+
tupstore = tuplestore_begin_heap(true, false, work_mem);
654654

655655
MemoryContextSwitchTo(oldcontext);
656656

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy