1. 21 7月, 2011 3 次提交
    • T
      Make xpath() do something useful with XPath expressions that return scalars. · 0ce7676a
      Tom Lane 提交于
      Previously, xpath() simply returned an empty array if the expression did
      not yield a node set.  This is useless for expressions that return scalars,
      such as one with name() at the top level.  Arrange to return the scalar
      value as a single-element xml array, instead.  (String values will be
      suitably escaped.)
      
      This change will also cause xpath_exists() to return true, not false,
      for such expressions.
      
      Florian Pflug, reviewed by Radoslaw Smogura
      0ce7676a
    • T
      Ensure that xpath() escapes special characters in string values. · aaf15e5c
      Tom Lane 提交于
      Without this it's possible for the output to not be legal XML, as
      illustrated by the added regression test cases.
      
      NB: this change will need to be called out as an incompatibility in the
      9.2 release notes, since it's possible somebody was relying on the old
      behavior, even though it's clearly wrong.
      
      Florian Pflug, reviewed by Radoslaw Smogura
      aaf15e5c
    • T
      Rewrite libxml error handling to be more robust. · cacd42d6
      Tom Lane 提交于
      libxml reports some errors (like invalid xmlns attributes) via the error
      handler hook, but still returns a success indicator to the library caller.
      This causes us to miss some errors that are important to report.  Since the
      "generic" error handler hook doesn't know whether the message it's getting
      is for an error, warning, or notice, stop using that and instead start
      using the "structured" error handler hook, which gets enough information
      to be useful.
      
      While at it, arrange to save and restore the error handler hook setting in
      each libxml-using function, rather than assuming we can set and forget the
      hook.  This should improve the odds of working nicely with third-party
      libraries that also use libxml.
      
      In passing, volatile-ize some local variables that get modified within
      PG_TRY blocks.  I noticed this while testing with an older gcc version
      than I'd previously tried to compile xml.c with.
      
      Florian Pflug and Tom Lane, with extensive review/testing by Noah Misch
      cacd42d6
  2. 14 8月, 2010 1 次提交
  3. 09 8月, 2010 1 次提交
  4. 05 8月, 2010 1 次提交
  5. 10 6月, 2009 1 次提交
  6. 09 4月, 2009 1 次提交
  7. 16 11月, 2008 1 次提交
  8. 02 9月, 2008 1 次提交
  9. 29 8月, 2008 1 次提交
    • T
      Extend the parser location infrastructure to include a location field in · a2794623
      Tom Lane 提交于
      most node types used in expression trees (both before and after parse
      analysis).  This allows us to place an error cursor in many situations
      where we formerly could not, because the information wasn't available
      beyond the very first level of parse analysis.  There's a fair amount
      of work still to be done to persuade individual ereport() calls to actually
      include an error location, but this gets the initdb-forcing part of the
      work out of the way; and the situation is already markedly better than
      before for complaints about unimplementable implicit casts, such as
      CASE and UNION constructs with incompatible alternative data types.
      Per my proposal of a few days ago.
      a2794623
  10. 09 11月, 2007 1 次提交
  11. 08 11月, 2007 2 次提交
  12. 19 6月, 2007 1 次提交
    • T
      Arrange for quote_identifier() and pg_dump to not quote keywords that are · 4c310eca
      Tom Lane 提交于
      unreserved according to the grammar.  The list of unreserved words has gotten
      extensive enough that the unnecessary quoting is becoming a bit of an eyesore.
      To do this, add knowledge of the keyword category to keywords.c's table.
      (Someday we might be able to generate keywords.c's table and the keyword lists
      in gram.y from a common source.)  For the moment, lie about WITH's status in
      the table so it will still get quoted --- this is because of the expectation
      that WITH will become reserved when the SQL recursive-queries patch gets done.
      
      I didn't force initdb because this affects nothing on-disk; but note that a
      few regression tests have changed expected output.
      4c310eca
  13. 22 5月, 2007 1 次提交
    • P
      XPath fixes: · 3963574d
      Peter Eisentraut 提交于
       - 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.
      3963574d
  14. 05 4月, 2007 1 次提交
  15. 23 3月, 2007 2 次提交
  16. 15 2月, 2007 1 次提交
  17. 03 2月, 2007 1 次提交
  18. 25 1月, 2007 1 次提交
    • P
      Various fixes in the logic of XML functions: · 22bd156f
      Peter Eisentraut 提交于
      - 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.
      22bd156f
  19. 20 1月, 2007 2 次提交
  20. 14 1月, 2007 1 次提交
  21. 13 1月, 2007 1 次提交
  22. 09 1月, 2007 1 次提交
  23. 08 1月, 2007 1 次提交
  24. 07 1月, 2007 1 次提交
  25. 28 12月, 2006 1 次提交
  26. 22 12月, 2006 2 次提交