Re: Error-safe user functions - Mailing list pgsql-hackers

From Corey Huinker
Subject Re: Error-safe user functions
Date
Msg-id CADkLM=e=VAwYOXHV+zPw8txUmhVP1GD2vyCMMq28jFAj7zV90A@mail.gmail.com
Whole thread Raw
In response to Re: Error-safe user functions  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers


On Wed, Dec 7, 2022 at 12:17 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Corey Huinker <corey.huinker@gmail.com> writes:
> In my attempt to implement CAST...DEFAULT, I noticed that I immediately
> needed an
> OidInputFunctionCallSafe, which was trivial but maybe something we want to
> add to the infra patch, but the comments around that function also somewhat
> indicate that we might want to just do the work in-place and call
> InputFunctionCallSafe directly. Open to both ideas.

I'm a bit skeptical of that.  IMO using OidInputFunctionCall is only
appropriate in places that will be executed just once per query.

That is what's happening when the expr of the existing CAST ( expr AS typename ) is a constant and we want to just resolve the constant at parse time.
 

pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: moving extraUpdatedCols out of RangeTblEntry (into ModifyTable)
Next
From: Andres Freund
Date:
Subject: Re: allow segment size to be set to < 1GiB