]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Make cast functions from jsonb error safe
authorPeter Eisentraut <peter@eisentraut.org>
Sat, 28 Mar 2026 14:44:13 +0000 (15:44 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Sat, 28 Mar 2026 14:44:13 +0000 (15:44 +0100)
commit10e4d8aaf46fb46b8b78e026560b68af84a6495b
tree9b0a93584eb9822d78400c7239177a9fbd6b5360
parent999dec9ec6a81668057427c2e9312b20635fba02
Make cast functions from jsonb error safe

This adjusts cast functions from jsonb to other types to support soft
errors.  This just involves some refactoring of the underlying helper
functions to use ereturn.

This is in preparation for a future feature where conversion errors in
casts can be caught.

Author: jian he <jian.universality@gmail.com>
Reviewed-by: Amul Sul <sulamul@gmail.com>
Reviewed-by: Corey Huinker <corey.huinker@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/CADkLM%3Dfv1JfY4Ufa-jcwwNbjQixNViskQ8jZu3Tz_p656i_4hQ%40mail.gmail.com
src/backend/utils/adt/jsonb.c