Re: custom function for converting human readable sizes to bytes

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: custom function for converting human readable sizes to bytes
Дата
Msg-id CAFj8pRBTBmX98Gy5vXNf8kXTtW=uKxHV8VXV=9XOHu2qgfXhKA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: custom function for converting human readable sizes to bytes  (Vitaly Burovoy <vitaly.burovoy@gmail.com>)
Ответы Re: custom function for converting human readable sizes to bytes  (Vitaly Burovoy <vitaly.burovoy@gmail.com>)
Список pgsql-hackers
Hi


P.S.: Have you thought to wrap the call "numeric_in" by a
PG_TRY/PG_CATCH instead of checking for correctness by yourself?

I though about it, but it is not possible. Every PG_TRY/CATCH must be finished by RETHROW. Only when you will open subtransaction and you are playing with resource manager, you can do it. It is pretty expensive.

You can see in our code lot of situation when some function returns true, false, "error message" instead raising a exception. I would not to refactor numericin function in this style. This function is in critical path of COPY FROM, and any more calls can decrease performance. And then I have to do these checks before calling.

Regards

Pavel
 

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

Предыдущее
От: Vitaly Burovoy
Дата:
Сообщение: Re: custom function for converting human readable sizes to bytes
Следующее
От: Dilip Kumar
Дата:
Сообщение: Re: Move PinBuffer and UnpinBuffer to atomics