Re: Why is fncollation in FunctionCallInfoData rather than fmgr_info?

2018-06-06 Thread Tom Lane
Andres Freund writes: > On 2018-06-06 21:25:14 +0100, Andrew Gierth wrote: >> The obvious case which is not one of those "pretty much all cases" is >> where DirectFunctionCallN[Coll] is used - which turns out to be not all >> that unusual. > There the callsite just lives for just one call, I don'

Re: Why is fncollation in FunctionCallInfoData rather than fmgr_info?

2018-06-06 Thread Andres Freund
Hi, On 2018-06-06 21:25:14 +0100, Andrew Gierth wrote: > > "Andres" == Andres Freund writes: > > Andres> I think it's not unreasonable to think of it that way, but it's > Andres> really not how it is used today. In pretty much all cases the > Andres> collation is known and determined at t

Re: Why is fncollation in FunctionCallInfoData rather than fmgr_info?

2018-06-06 Thread Andrew Gierth
> "Andres" == Andres Freund writes: Andres> I think it's not unreasonable to think of it that way, but it's Andres> really not how it is used today. In pretty much all cases the Andres> collation is known and determined at the time fmgr_info() is Andres> called (we also commonly reuse Fun

Re: Why is fncollation in FunctionCallInfoData rather than fmgr_info?

2018-06-06 Thread Andres Freund
Hi, On 2018-06-06 11:17:33 -0400, Tom Lane wrote: > Peter Eisentraut writes: > > On 6/6/18 09:06, Andres Freund wrote: > >> FmgrInfo really *is* call-site dependent, no? fn_extra, fn_mcxt, fn_expr > >> all are. I think it's more useful to view the FmgrInfo / > >> FunctionCallInfo data split as t

Re: Why is fncollation in FunctionCallInfoData rather than fmgr_info?

2018-06-06 Thread Tom Lane
Peter Eisentraut writes: > On 6/6/18 09:06, Andres Freund wrote: >> FmgrInfo really *is* call-site dependent, no? fn_extra, fn_mcxt, fn_expr >> all are. I think it's more useful to view the FmgrInfo / >> FunctionCallInfo data split as the separation between per-callsite and >> per-call data. And

Re: Why is fncollation in FunctionCallInfoData rather than fmgr_info?

2018-06-06 Thread Peter Eisentraut
On 6/6/18 09:06, Andres Freund wrote: >> It's true that we often abuse fn_extra to hold data that's essentially >> call-site-dependent, but I don't think that's a good reason to push >> collation into FmgrInfo. > FmgrInfo really *is* call-site dependent, no? fn_extra, fn_mcxt, fn_expr > all are. I

Re: Why is fncollation in FunctionCallInfoData rather than fmgr_info?

2018-06-06 Thread Andres Freund
Hi, On 2018-06-06 01:01:49 -0400, Tom Lane wrote: > Andres Freund writes: > > In my understanding FunctionCallInfoData is basically per-call data, > > whereas FmgrInfo is information about the function. It makes some sense > > that ->context is in FunctionCallInfoData, after all it's used for >

Re: Why is fncollation in FunctionCallInfoData rather than fmgr_info?

2018-06-06 Thread Andres Freund
On 2018-06-05 17:11:17 -0400, Chapman Flack wrote: > On 06/05/2018 04:57 PM, Andres Freund wrote: > > But we don't really change the > > collation of function invocations per-call. > > Is that true? (Not a rhetorical question; I'm unsure.) Yes, it is at the moment. > Is your argument that the

Re: Why is fncollation in FunctionCallInfoData rather than fmgr_info?

2018-06-05 Thread Tom Lane
Andres Freund writes: > In my understanding FunctionCallInfoData is basically per-call data, > whereas FmgrInfo is information about the function. It makes some sense > that ->context is in FunctionCallInfoData, after all it's used for > per-row data like the trigger context. But we don't really

Re: Why is fncollation in FunctionCallInfoData rather than fmgr_info?

2018-06-05 Thread Chapman Flack
On 06/05/2018 04:57 PM, Andres Freund wrote: > But we don't really change the > collation of function invocations per-call. Is that true? (Not a rhetorical question; I'm unsure.) Is your argument that the expression's collation is determined once for each call /site/, and thereafter doesn't chan

Why is fncollation in FunctionCallInfoData rather than fmgr_info?

2018-06-05 Thread Andres Freund
Hi, In my understanding FunctionCallInfoData is basically per-call data, whereas FmgrInfo is information about the function. It makes some sense that ->context is in FunctionCallInfoData, after all it's used for per-row data like the trigger context. But we don't really change the collation of f