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.