Re: Why is fncollation in FunctionCallInfoData rather than fmgr_info? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Why is fncollation in FunctionCallInfoData rather than fmgr_info?
Date
Msg-id 9136.1528261309@sss.pgh.pa.us
Whole thread Raw
In response to Why is fncollation in FunctionCallInfoData rather than fmgr_info?  (Andres Freund <andres@anarazel.de>)
Responses Re: Why is fncollation in FunctionCallInfoData rather than fmgr_info?
List pgsql-hackers
Andres Freund <andres@anarazel.de> 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 change the
> collation of function invocations per-call.  Thus I don't quite get why
> FunctionCallInfoData contains information about it rather than FmgrInfo.

[squint]  I would say that the call collation is an argument, not a
property of the function, and therefore is correctly located in
FunctionCallInfoData.

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.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Loaded footgun open_datasync on Windows
Next
From: David Rowley
Date:
Subject: Re: why partition pruning doesn't work?