Re: Error-safe user functions

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: Error-safe user functions
Дата
Msg-id 9c8f22f2-7a37-fc4d-8e9f-3431c0d09c5a@dunslane.net
обсуждение исходный текст
Ответ на Re: Error-safe user functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Error-safe user functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Error-safe user functions  (Ted Yu <yuzhihong@gmail.com>)
Список pgsql-hackers
On 2022-12-22 Th 11:44, Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>> Yeah, I started there, but it's substantially more complex - unlike cube
>> the jsonpath scanner calls the error routines as well as the parser.
>> Anyway, here's a patch.
> I looked through this and it seems generally OK.  A minor nitpick is
> that we usually write "(Datum) 0" not "(Datum) NULL" for dont-care Datum
> values.  


Fixed in the new version attached.


> A slightly bigger issue is that makeItemLikeRegex still allows
> an error to be thrown from RE_compile_and_cache if a bogus regex is
> presented.  But that could be dealt with later.


I'd rather fix it now while we're paying attention.


>
> (I wonder why this is using RE_compile_and_cache at all, really,
> rather than some other API.  There doesn't seem to be value in
> forcing the regex into the cache at this point.)
>
>             


I agree. The attached uses pg_regcomp instead. I had a lift a couple of
lines from regexp.c, but not too many.


cheers


andrew


--
Andrew Dunstan
EDB: https://www.enterprisedb.com

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: Add LSN along with offset to error messages reported for WAL file read/write/validate header failures
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Making Vars outer-join aware