Re: [REVIEW] Re: Fix xpath() to return namespace definitions - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [REVIEW] Re: Fix xpath() to return namespace definitions
Date
Msg-id 13665.1404775506@sss.pgh.pa.us
Whole thread Raw
In response to [REVIEW] Re: Fix xpath() to return namespace definitions  (Abhijit Menon-Sen <ams@2ndQuadrant.com>)
Responses Re: [REVIEW] Re: Fix xpath() to return namespace definitions  (Ali Akbar <the.apaan@gmail.com>)
List pgsql-hackers
Abhijit Menon-Sen <ams@2ndQuadrant.com> writes:
> I can confirm that it works fine. I have attached here a very slightly
> tweaked version of the patch (removed trailing whitespace, and changed
> some comment text).

> I'm marking this ready for committer.

I don't know enough about XML/XPATH to know if this is a good idea or not,
but I did go read the documentation of xmlCopyNode(), and I notice it says
the second argument is

extended: if 1 do a recursive copy (properties, namespaces and children
when applicable) if 2 copy properties and namespaces (when applicable)

Do we really want it to "copy children"?  Perhaps the value should be 2?
(I have no idea, I'm just raising the question.)

I also notice that it says

Returns: a new #xmlNodePtr, or NULL in case of error.

and the patch is failing to cover the error case.  Most likely, that
would represent out-of-memory, so it definitely seems to be something
we should account for.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_dump reporing version of server & pg_dump as comments in the output
Next
From: Robert Haas
Date:
Subject: Re: [PATCH] Improve bytea error messages