We'd still have functions like jsonb_field_as_numeric() under the hood, but there's not an expectation that users call them explicitly.To avoid the lots of functions like jsonb_field_as_int2/int4, I definedDatum jsonb_object_field_type(.., Oid target_oid) at last, so thefunction must return "internal" or "anyelement". Then we can see:select jsonb_object_field_type(tb.a, 'a'::text, 1700) from tb;ERROR: cannot display a value of type anyelement.
We'd still have functions like jsonb_field_as_numeric() under the hood, but there's not an expectation that users call them explicitly.
The reason is clear to me, but I'm not sure how to fix that or deservesa fix? Or shall I define jsonb_object_field_int2/int8 to avoid this? This is an unresolved issue at the latest patch. -- Best RegardsAndy Fan
pgsql-hackers by date:
Соглашаюсь с условиями обработки персональных данных