Re: jsonpath - Mailing list pgsql-hackers

From Andres Freund
Subject Re: jsonpath
Date
Msg-id 20190129010332.i4t64evqc3bwtjzx@alap3.anarazel.de
Whole thread Raw
In response to Re: jsonpath  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Responses Re: jsonpath  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Re: jsonpath  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
List pgsql-hackers
Hi,

On 2019-01-29 04:00:19 +0300, Alexander Korotkov wrote:
> +    /*
> +     * It is safe to use here PG_TRY/PG_CATCH without subtransaction because
> +     * no function called inside performs data modification.
> +     */
> +    PG_TRY();
> +    {
> +        res = DirectFunctionCall2(func, ldatum, rdatum);
> +    }
> +    PG_CATCH();
> +    {
> +        int            errcode = geterrcode();
> +
> +        if (jspThrowErrors(cxt) ||
> +            ERRCODE_TO_CATEGORY(errcode) != ERRCODE_DATA_EXCEPTION)
> +            PG_RE_THROW();
> +
> +        MemoryContextSwitchTo(mcxt);
> +        FlushErrorState();
> +
> +        return jperError;
> +    }
> +    PG_END_TRY();

FWIW, I still think this is a terrible idea and shouldn't be merged this
way. The likelihood of introducing subtle bugs seems way too high - even
if it's possibly not buggy today, who says that it's not going to be in
the future?

Greetings,

Andres Freund


pgsql-hackers by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: jsonpath
Next
From: Alexander Korotkov
Date:
Subject: Re: jsonpath