On 02.03.2018 00:57, Alexander Korotkov wrote:
Attached 12th version of jsonpath patches.
I added the 7th patch where the following functions were extracted for
safe error handling in jsonpath:
numeric_add_internal()
numeric_sub_internal()
numeric_mul_internal()
numeric_div_internal()
numeric_mod_internal()
float8_numeric_internal()
numeric_float8_internal()
float8in_internal()
Errors are passed to caller with new ereport_safe() macro when
ErrorData **edata is not NULL:
+#define ereport_safe(edata, elevel, rest) \
+ do { \
+ if (edata) { \
+ errstart(elevel, __FILE__, __LINE__, PG_FUNCNAME_MACRO, TEXTDOMAIN); \
+ (rest); \
+ *(edata) = CopyErrorData(); \
+ FlushErrorState(); \
+ } else { \
+ ereport(elevel, rest); \
+ } \
+ } while (0)
But to_datetime() is still called in jsonpath inside PG_TRY/PG_CATCH block
because it needs too deep error propagation.
--
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company