Re: More new SQL/JSON item methods - Mailing list pgsql-hackers

From Tom Lane
Subject Re: More new SQL/JSON item methods
Date
Msg-id 1691834.1706506402@sss.pgh.pa.us
Whole thread Raw
In response to Re: More new SQL/JSON item methods  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Responses Re: More new SQL/JSON item methods
List pgsql-hackers
Kyotaro Horiguchi <horikyota.ntt@gmail.com> writes:
> Having said that, I'm a bit concerned about the case where an overly
> long string is given there. However, considering that we already have
> "invalid input syntax for type xxx: %x" messages (including for the
> numeric), this concern might be unnecessary.

Yeah, we have not worried about that in the past.

> Another concern is that the input value is already a numeric, not a
> string. This situation occurs when the input is NaN of +-Inf. Although
> numeric_out could be used, it might cause another error. Therefore,
> simply writing out as "argument NaN and Infinity.." would be better.

Oh!  I'd assumed that we were discussing a string that we'd failed to
convert to numeric.  If the input is already numeric, then either
the error is unreachable or what we're really doing is rejecting
special values such as NaN on policy grounds.  I would ask first
if that policy is sane at all.  (I'd lean to "not" --- if we allow
it in the input JSON, why not in the output?)  If it is sane, the
error message needs to be far more specific.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Update the doc that refers to the removed column of pg_replication_slots.
Next
From: Amit Kapila
Date:
Subject: Re: Fix inappropriate comments in function ReplicationSlotAcquire