On 04/09/25 10:03, Tom Lane wrote:
> I think I stole it from DB2:
>
> 10608 An error was encountered in the argument of an XQuery function or
> operator.
Interesting. ISO does seem to reserve a class 10 for XQuery errors, but
not to define any subclass codes within it.
Every other SQL/XML error
Peter Eisentraut writes:
> On 14.09.24 21:14, Tom Lane wrote:
>> +Section: Class 10 - XQuery Error
>> +
>> +# recent SQL versions define quite a few codes in this class, but for now
>> +# we are only using this generic one
>> +10608EERRCODE_INVALID_ARGUMENT_FOR_XQUERY
On 14.09.24 21:14, Tom Lane wrote:
+Section: Class 10 - XQuery Error
+
+# recent SQL versions define quite a few codes in this class, but for now
+# we are only using this generic one
+10608EERRCODE_INVALID_ARGUMENT_FOR_XQUERY
invalid_argument_for_xquery
Coul
Daniel Gustafsson writes:
> On 23 Sep 2024, at 19:17, Tom Lane wrote:
>> Yeah, I looked at that but wasn't sure what to do with it. We should
>> have validated the decl header when the XML value was created, so if
>> we get here then either the value got corrupted on-disk or in-transit,
>> or so
> On 23 Sep 2024, at 19:17, Tom Lane wrote:
> Daniel Gustafsson writes:
>
>> There is an ERRCODE_INTERNAL_ERROR in xml_out_internal() which seems a tad
>> odd
>> given that any error would be known to be parsing related and b) are caused
>> by
>> libxml and not internally. Not sure if it's wo
Daniel Gustafsson writes:
>> On 20 Sep 2024, at 21:00, Tom Lane wrote:
>> Per cfbot, rebased over d5622acb3. No functional changes.
> Looking over these I don't see anything mis-characterized so +1 on going ahead
> with these. It would be neat if we end up translating xml2 errors into XQuery
>
> On 20 Sep 2024, at 21:00, Tom Lane wrote:
>
> I wrote:
>> [ v1-clean-up-errcodes-for-xml.patch ]
>
> Per cfbot, rebased over d5622acb3. No functional changes.
Looking over these I don't see anything mis-characterized so +1 on going ahead
with these. It would be neat if we end up translating
I wrote:
> [ v1-clean-up-errcodes-for-xml.patch ]
Per cfbot, rebased over d5622acb3. No functional changes.
regards, tom lane
diff --git a/contrib/xml2/xpath.c b/contrib/xml2/xpath.c
index 0fdf735faf..ef78aa00c8 100644
--- a/contrib/xml2/xpath.c
+++ b/contrib/xml2/xpath.
I noticed while working on bug #18617 [1] that we are fairly slipshod
about which SQLSTATE to report when libxml2 returns an error. There
are places using ERRCODE_INTERNAL_ERROR for easily-triggered errors;
there are different places that use different ERRCODEs for exactly
the same condition; and