pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Make cast functions from jsonb error safe
Date: Sat, 28 Mar 2026 14:57:34 +0000
Message-ID: <E1w6V6T-001rZH-0W@gemulon.postgresql.org> (raw)

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%40m...

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/10e4d8aaf46fb46b8b78e026560b68af84a6495b

Modified Files
--------------
src/backend/utils/adt/jsonb.c | 35 ++++++++++++++++++-----------------
1 file changed, 18 insertions(+), 17 deletions(-)



Message-ID: <E1w6V6T-001rZH-0W@gemulon.postgresql.org>
Permalink:  ../E1w6V6T-001rZH-0W@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1w6V6T-001rZH-0W@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Make cast functions from jsonb error safe
  In-Reply-To: <E1w6V6T-001rZH-0W@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox