RE: Better performance no-throw conversion?

2021-09-08 Thread l...@laurent-hasson.com
> -Original Message- > From: Andrew Dunstan > Sent: Wednesday, September 8, 2021 13:31 > To: l...@laurent-hasson.com; pgsql-performa...@postgresql.org > Subject: Re: Better performance no-throw conversion? > > > On 9/8/21 1:17 PM, l...@laurent-hasson.co

RE: Better performance no-throw conversion?

2021-09-08 Thread l...@laurent-hasson.com
> From: Michael Lewis > Sent: Wednesday, September 8, 2021 13:40 > To: Tom Lane > Cc: l...@laurent-hasson.com; pgsql-performa...@postgresql.org > Subject: Re: Better performance no-throw conversion? > > On Wed, Sep 8, 2021 at 11:33 AM Tom Lane wrote: > "mailto:l...@l

Re: Better performance no-throw conversion?

2021-09-08 Thread Michael Lewis
On Wed, Sep 8, 2021 at 11:33 AM Tom Lane wrote: > "l...@laurent-hasson.com" writes: > > Some databases such as SQLServer (try_cast) or BigQuery (safe.cast) > offer not-throw conversion. > > ... > > I couldn't find a reference to such capabilities in Postgres and > wondered if I missed it, and if

Re: Better performance no-throw conversion?

2021-09-08 Thread Tom Lane
"l...@laurent-hasson.com" writes: > Some databases such as SQLServer (try_cast) or BigQuery (safe.cast) offer > not-throw conversion. > ... > I couldn't find a reference to such capabilities in Postgres and wondered if > I missed it, and if not, is there any plan to add such a feature? There is

Re: Better performance no-throw conversion?

2021-09-08 Thread Andrew Dunstan
On 9/8/21 1:17 PM, l...@laurent-hasson.com wrote: > > Hello, > >   > > Some databases such as SQLServer (try_cast) or BigQuery (safe.cast) > offer not-throw conversion. In general, these tend to perform better > than custom UDFs that catch exceptions and are also simpler to use. > For example, in

Better performance no-throw conversion?

2021-09-08 Thread l...@laurent-hasson.com
Hello, Some databases such as SQLServer (try_cast) or BigQuery (safe.cast) offer not-throw conversion. In general, these tend to perform better than custom UDFs that catch exceptions and are also simpler to use. For example, in Postgres, I have a function that does the following: CREATE OR REP