Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: cf/5718~1
Choose a base ref
...
head repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cf/5718
Choose a head ref
  • 3 commits
  • 7 files changed
  • 2 contributors

Commits on May 31, 2025

  1. contrib/xml2: xslt_process() now reports XSLT-related error details

    * It sets (and restores) the libxslt error handler (xsltSetGenericErrorFunc()).
      Since it only supports old-school "generic" error handlers, which are no longer
      used in PG's libxml code, we reintroduced a "generic" error handler
      xml_generic_error_handler() in xml.c.
    * The alternative would have been to expose PgXmlErrorContext in xml.h,
      so we could implement a generic handler in xslt_proc.c.
      This is obviously not desirable, as it would depend on USE_LIBXML.
    * No longer use the PG_XML_STRICTNESS_LEGACY for error handling,
      but query the error_occurred-flag via pg_xml_error_occurred().
      The existance of this getter is another hint, that we are not supposed
      to expose PgXmlErrorContext in xml.h.
    * This change means that xslt_process() now reports not only details
      about XML parsing errors, but XSLT-schema deviations and missing
      stylesheet parameters as well.
    * The XSLT error messages now also contain line numbers.
      For that to work, we had to set a dummy "SQL" URL when parsing XML strings.
      This is important, since xsltPrintErrorContext() includes
      line numbers only if an URL is set.
    * The xsltSaveResultToString() error handling has been removed.
      It can practically only fail in OOM situations and there is no reason
      to handle them any different than with the other libxslt functions.
    * Updated test suite and added test case for detecting missing
      stylesheet parameters.
      This was initially reported here but has obviously been fixed in the
      meantime:
      https://www.postgresql.org/message-id/4C5ECEF9.3030806%40mlfowler.com
    Robin Haberkorn authored and Commitfest Bot committed May 31, 2025
    Configuration menu
    Copy the full SHA
    7bf93b7 View commit details
    Browse the repository at this point in the history
  2. contrib/xml2: overloaded xslt_process() to provide variants for xmlty…

    …pe and specifying parameters in arrays
    
    * There are apparently no functions that accept XML as text, except for xmlparse().
      xslt_process() should therefore also accept xmltype.
    * A version accepting text is still kept for backwards compatibility, but is considered
      deprecated.
    * The new xmltype-based version expects an array of stylesheet parameter-value pairs,
      which is less limited than the now deprecated way of encoding all stylesheet parameters into
      a single text argument.
      We can now accept an arbitrary number of parameters and you can include `=` and `,` signs
      in both the key and value strings.
      Hstores haven't been used since they are in a module and we don't want to depend on any
      additional module.
    * The new implementation respects the database's encoding - text strings are always converted to UTF8
      before passing them into libxml2.
    * On the downside, xml_parse() had to be made an external function.
      Since a declaration cannot be added to xml.h without drawing in libxml2 headers,
      the declaration is repeated in xslt_proc.c.
      Perhaps xml_parse() should be declared in a separate internal header?
    * xmlCtxtReadDoc() now sets a dummy "SQL" URL to preserve line numbers in XSLT stylesheet errors.
      This change at least does not break the test suite.
    Robin Haberkorn authored and Commitfest Bot committed May 31, 2025
    Configuration menu
    Copy the full SHA
    28440c2 View commit details
    Browse the repository at this point in the history
  3. [CF 5718] v3 - contrib/xml2: xslt_process() should report XSLT-relate…

    …d error details and accept xmltype
    
    This branch was automatically generated by a robot using patches from an
    email thread registered at:
    
    https://commitfest.postgresql.org/patch/5718
    
    The branch will be overwritten each time a new patch version is posted to
    the thread, and also periodically to check for bitrot caused by changes
    on the master branch.
    
    Patch(es): https://www.postgresql.org/message-id/D9PS2YM0OS8H.D27X2G7ZEQRS@b1-systems.de
    Author(s): Robin Haberkorn
    Commitfest Bot committed May 31, 2025
    Configuration menu
    Copy the full SHA
    5400f39 View commit details
    Browse the repository at this point in the history
Loading