xml_is_document and selective pg_re_throw - Mailing list pgsql-hackers

From Nikhil Sontakke
Subject xml_is_document and selective pg_re_throw
Date
Msg-id CANgU5ZcgN0dDFPCbm6TY9SZTfgCMGjL3RKqnEZALHQOWV-mVaA@mail.gmail.com
Whole thread Raw
Responses Re: xml_is_document and selective pg_re_throw
List pgsql-hackers
Hi, <br /><br />Consider:<br /><br />SELECT xml '<foo>bar</foo><bar>foo</bar>' IS DOCUMENT;<br
/><br/>And I was looking at xml_is_document() source code. It calls xml_parse which throws an error with code set to
ERRCODE_INVALID_XML_DOCUMENT.The catch block of xml_parse then rethrows. <br /><br />Now xml_is_document does a
selectiverethrow only if the error is not ERRCODE_INVALID_XML_DOCUMENT. I can understand that this function does this
toreturn true/false, but doesn't this behavior of not propagating the error up all the way dangerous?
InterruptHoldoffCountinconsistencies for instance? <br /><br />A better way would have been to modify xml_parse to take
anadditional boolean argument "to_rethrow" and not to rethrow if that is false? Thoughts? <br /><br />Regards,<br
/>Nikhils<br /> 

pgsql-hackers by date:

Previous
From: Thom Brown
Date:
Subject: Re: pg_basebackup --xlog compatibility break
Next
From: Kyotaro HORIGUCHI
Date:
Subject: Re: Skip checkpoint on promoting from streaming replication