Re: custom function for converting human readable sizes to bytes - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: custom function for converting human readable sizes to bytes
Date
Msg-id CAFj8pRBTBmX98Gy5vXNf8kXTtW=uKxHV8VXV=9XOHu2qgfXhKA@mail.gmail.com
Whole thread Raw
In response to Re: custom function for converting human readable sizes to bytes  (Vitaly Burovoy <vitaly.burovoy@gmail.com>)
Responses Re: custom function for converting human readable sizes to bytes  (Vitaly Burovoy <vitaly.burovoy@gmail.com>)
List 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 by date:

Previous
From: Vitaly Burovoy
Date:
Subject: Re: custom function for converting human readable sizes to bytes
Next
From: Dilip Kumar
Date:
Subject: Re: Move PinBuffer and UnpinBuffer to atomics