aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/xml.c
Commit message (Collapse)AuthorAge
...
* Add missing closing / in xsd:restriction, and remove some unnecessaryTom Lane2007-11-10
| | | | | spaces for consistency. Per bug #3734 from Ben Leslie; fix by Euler Taveira de Oliveira.
* xmlGetUTF8Char()'s second argument is both input and output. FixTom Lane2007-11-10
| | | | | | uninitialized value, and avoid invoking the function nine separate times in the pg_xmlIsNameChar macro. Should resolve buildfarm failures. Per report from Ben Leslie.
* Allow XML processing instructions starting with "xml" while prohibitingPeter Eisentraut2007-11-09
| | | | those being exactly "xml". Bug #3735 from Ben Leslie
* After conferencing again with Bruce, put in more accurate XML error message.Peter Eisentraut2007-11-08
|
* Improve error messagePeter Eisentraut2007-11-08
|
* Some code review for xml.c:Tom Lane2007-11-06
| | | | | | | | | | | | | | Add some more xml_init() calls that might not be necessary, but seem like a good idea to avoid possible problems like we saw in xmlelement(). Fix unsafe assumption that you can keep using the tupledesc of a relcache entry you don't have open. Add missing error checks for SearchSysCache failure. Get rid of handwritten array traversal in xpath() and O(N^2), broken-for-nulls array access code in map_sql_value_to_xml_value(), in favor of using deconstruct_array. Manually adjust a lot of line breaks in places where the code is otherwise gonna look pretty awful after pg_indent hacks it up (original author seems to have liked to lay out code for a 200-column window).
* Fix xmlelement() to initialize libxml correctly before using it, and to avoidTom Lane2007-11-05
| | | | | | | | | | assuming that evaluation of its input expressions won't change the state of libxml. This requires refactoring xml_init() to not call xmlInitParser(), since now not all of its callers want that. I also tweaked things to avoid repeated execution of one-time-only tests inside xml_init(), though this is mostly for clarity rather than in hopes of saving any noticeable amount of runtime. Per report from Sheikh Amjad and subsequent discussion. In passing, fix a couple of inadequately schema-qualified queries.
* Guard against possible double free during error escape from XMLTom Lane2007-10-13
| | | | | functions. Patch for the reported issue from Kris Jurka, some other potential trouble spots plugged by Tom.
* Fix the inadvertent libpq ABI breakage discovered by Martin Pitt: theTom Lane2007-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | renumbering of encoding IDs done between 8.2 and 8.3 turns out to break 8.2 initdb and psql if they are run with an 8.3beta1 libpq.so. For the moment we can rearrange the order of enum pg_enc to keep the same number for everything except PG_JOHAB, which isn't a problem since there are no direct references to it in the 8.2 programs anyway. (This does force initdb unfortunately.) Going forward, we want to fix things so that encoding IDs can be changed without an ABI break, and this commit includes the changes needed to allow libpq's encoding IDs to be treated as fully independent of the backend's. The main issue is that libpq clients should not include pg_wchar.h or otherwise assume they know the specific values of libpq's encoding IDs, since they might encounter version skew between pg_wchar.h and the libpq.so they are using. To fix, have libpq officially export functions needed for encoding name<=>ID conversion and validity checking; it was doing this anyway unofficially. It's still the case that we can't renumber backend encoding IDs until the next bump in libpq's major version number, since doing so will break the 8.2-era client programs. However the code is now prepared to avoid this type of problem in future. Note that initdb is no longer a libpq client: we just pull in the two source files we need directly. The patch also fixes a few places that were being sloppy about checking for an unrecognized encoding name.
* Fix bugs in XML binary I/O functions. Heikki and TomTom Lane2007-09-23
|
* Fix map_sql_typecoll_to_xmlschema_types() to not fail on droppedTom Lane2007-07-13
| | | | | columns, per my gripe earlier today. Make it look a bit less like someone's first effort at backend coding.
* Compute max and min int8 values using unsigned arithmetic, in hopes ofTom Lane2007-07-12
| | | | suppressing Sun Studio compiler warnings. Per Stefan.
* Fix up text concatenation so that it accepts all the reasonable cases thatTom Lane2007-06-06
| | | | | | | | were accepted by prior Postgres releases. This takes care of the loose end left by the preceding patch to downgrade implicit casts-to-text. To avoid breaking desirable behavior for array concatenation, introduce a new polymorphic pseudo-type "anynonarray" --- the added concatenation operators are actually text || anynonarray and anynonarray || text.
* XPath fixes:Peter Eisentraut2007-05-21
| | | | | | | | | | | | | | | - Function renamed to "xpath". - Function is now strict, per discussion. - Return empty array in case when XPath expression detects nothing (previously, NULL was returned in such case), per discussion. - (bugfix) Work with fragments with prologue: select xpath('/a', '<?xml version="1.0"?><a /><b />'); // now XML datum is always wrapped with dummy <x>...</x>, XML prologue simply goes away (if any). - Some cleanup. Nikolay Samokhvalov Some code cleanup and documentation work by myself.
* Support varlena fields with single-byte headers and unaligned storage.Tom Lane2007-04-06
| | | | | | | | | This commit breaks any code that assumes that the mere act of forming a tuple (without writing it to disk) does not "toast" any fields. While all available regression tests pass, I'm not totally sure that we've fixed every nook and cranny, especially in contrib. Greg Stark with some help from Tom Lane
* Update XML error message text for missing libxml; update regressionBruce Momjian2007-04-05
| | | | output to match.
* Improve documentation/warning when --with-libxml is not used in theBruce Momjian2007-04-05
| | | | installation.
* Support enum data types. Along the way, use macros for the values ofTom Lane2007-04-02
| | | | | pg_type.typtype whereever practical. Tom Dunstan, with some kibitzing from Tom Lane.
* Mapping schemas and databases to XML and XML Schema.Peter Eisentraut2007-04-01
| | | | Refactor and document the remaining mapping code.
* Commit newest version of xmlpath().Bruce Momjian2007-03-22
| | | | Nikolay Samokhvalov
* Add xmlpath() to evaluate XPath expressions, with namespaces support.Bruce Momjian2007-03-22
| | | | Nikolay Samokhvalov
* Make use of plancache module for SPI plans. In particular, since plpgsqlTom Lane2007-03-15
| | | | | | | | | | | | uses SPI plans, this finally fixes the ancient gotcha that you can't drop and recreate a temp table used by a plpgsql function. Along the way, clean up SPI's API a little bit by declaring SPI plan pointers as "SPIPlanPtr" instead of "void *". This is cosmetic but helps to forestall simple programming mistakes. (I have changed some but not all of the callers to match; there are still some "void *"'s in contrib and the PL's. This is intentional so that we can see if anyone's compiler complains about it.)
* Add resetStringInfo(), which clears the content of a StringInfo, andNeil Conway2007-03-03
| | | | | | fixup various places in the tree that were clearing a StringInfo by hand. Making this function a part of the API simplifies client code slightly, and avoids needlessly peeking inside the StringInfo interface.
* Fix date/time formats for XML Schema output.Peter Eisentraut2007-03-01
| | | | Pavel Stehule
* Replace direct assignments to VARATT_SIZEP(x) with SET_VARSIZE(x, len).Tom Lane2007-02-27
| | | | | | | | | | | Get rid of VARATT_SIZE and VARATT_DATA, which were simply redundant with VARSIZE and VARDATA, and as a consequence almost no code was using the longer names. Rename the length fields of struct varlena and various derived structures to catch anyplace that was accessing them directly; and clean up various places so caught. In itself this patch doesn't change any behavior at all, but it is necessary infrastructure if we hope to play any games with the representation of varlena headers. Greg Stark and Tom Lane
* Better fix for determining minimum and maximum int64 values that doesn'tPeter Eisentraut2007-02-16
| | | | require stdint.h and works for "busted" int64.
* Add stdint.h includePeter Eisentraut2007-02-16
|
* Functions for mapping table data and table schemas to XML (a.k.a. XML export)Peter Eisentraut2007-02-16
|
* Un-break build on ANSI compilers (like msvc) by moving Assert to positionMagnus Hagander2007-02-13
| | | | after variable declarations.
* Add support for optionally escaping periods when converting SQL identifiersPeter Eisentraut2007-02-11
| | | | to XML names, which will be required for supporting XML export.
* Add proper mapping of boolean type data to XML Schema.Peter Eisentraut2007-02-10
|
* Implement XMLSERIALIZE for real. Analogously, make the xml to text castPeter Eisentraut2007-02-03
| | | | | | | | | observe the xmloption. Reorganize the representation of the XML option in the parse tree and the API to make it easier to manage and understand. Add regression tests for parsing back XML expressions.
* Reactivate libxml memory management via palloc, now that I think I'vePeter Eisentraut2007-01-27
| | | | | classified the conditions under which this is safe to do (see source code comment).
* Add trailing zero byte in Unicode codepoint conversion.Peter Eisentraut2007-01-27
|
* Various fixes in the logic of XML functions:Peter Eisentraut2007-01-25
| | | | | | | | | | | | | | | | - Add new SQL command SET XML OPTION (also available via regular GUC) to control the DOCUMENT vs. CONTENT option in implicit parsing and serialization operations. - Subtle corrections in the handling of the standalone property in xmlroot(). - Allow xmlroot() to work on content fragments. - Subtle corrections in the handling of the version property in xmlconcat(). - Code refactoring for producing XML declarations.
* Simplify handling of XML error messages: Just use the string provided byPeter Eisentraut2007-01-23
| | | | | | | | | libxml as the detail message. As per <http://archives.postgresql.org/pgsql-hackers/2006-12/msg01087.php>. For converting error codes to messages, we only need to cover those codes that we raise ourselves now.
* Fix xmlconcat by properly merging the XML declarations. Add aggregatePeter Eisentraut2007-01-20
| | | | function xmlagg.
* Add support for converting binary values (i.e. bytea) into xml values,Peter Eisentraut2007-01-19
| | | | | with new GUC parameter "xmlbinary" that controls the output encoding, as per SQL/XML standard.
* Clean up encoding issues in the xml type: In text mode, encodingPeter Eisentraut2007-01-18
| | | | | declarations are ignored and removed, in binary mode they are honored as specified by the XML standard.
* Add support for xmlval IS DOCUMENT expression.Peter Eisentraut2007-01-14
|
* Use XML output escaping also in XMLFOREST.Peter Eisentraut2007-01-12
|
* Allow for arbitrary data types as content in XMLELEMENT. The originalPeter Eisentraut2007-01-12
| | | | | coercion to type xml was a mistake. Escape values so they are valid XML character data.
* Use libxml's xmlwriter API for producing XML elements, instead of doingPeter Eisentraut2007-01-10
| | | | | our own printing dance. This does a better job of quoting and escaping the values.
* Some fine-tuning of xmlpi in corner cases:Peter Eisentraut2007-01-07
| | | | | | - correct error codes - do syntax checks in correct order - strip leading spaces of argument
* Allow XML fragment to contain a XML declaration. For that, we need a smallPeter Eisentraut2007-01-07
| | | | | hand-crafted parser for the XML declaration, because libxml doesn't seem to allow this.
* Replace xmlroot with a properly functioning version that parses the value,Peter Eisentraut2007-01-06
| | | | | | | | | sets the items, and serializes the value back (rather than adding an arbitrary number of XML preambles as before). The libxml memory management via palloc had to be disabled because it crashes when libxml tries to access memory that was helpfully freed earlier by PostgreSQL. This needs further thought.
* Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian2007-01-05
| | | | back-stamped for this.
* Fix multiple breakages in last XML patch.Tom Lane2006-12-29
|
* De-escape XML names when reverse-compiling XML expressions.Peter Eisentraut2006-12-29
|
* Add send and recv functions for xml type.Peter Eisentraut2006-12-28
|