]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Make geometry cast functions error safe
authorPeter Eisentraut <peter@eisentraut.org>
Sun, 29 Mar 2026 18:40:50 +0000 (20:40 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Sun, 29 Mar 2026 18:40:50 +0000 (20:40 +0200)
commit45cdaf3665bedfbabb908bb84284f3db26781ad3
treea37f1d7210f0ffeb8a51695d195e56a22e5d5aba
parentd4cb9c37765a3d07784602679a1e7af7ecf15f1d
Make geometry cast functions error safe

This adjusts cast functions of the geometry types to support soft
errors.  This requires refactoring of various helper functions to
support error contexts.  Also make the float8 to float4 cast error
safe.  It requires some of the same helper functions.

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

(The function casting type circle to type polygon is not yet made error
safe, because it is an SQL language function.)

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/float.c
src/backend/utils/adt/geo_ops.c
src/include/utils/float.h