Re: Properly handling aggregate in nested function call - Mailing list pgsql-general

From Matt Magoffin
Subject Re: Properly handling aggregate in nested function call
Date
Msg-id D1E590B4-305C-472D-9063-F0061BEB2974@msqr.us
Whole thread Raw
In response to Re: Properly handling aggregate in nested function call  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On 16/12/2021, at 2:43 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Of course what this function is actually returning is numeric[].
> There is some code such as array_out that will look at the
> element type OID embedded in the array value, and do the right
> thing.  But other code will believe the function's declared
> result type, and that sort of code will go wrong.

(Hand slap to face!) Oh my, thank you for spotting that, this has been driving me to distraction, thinking I was doing
somethingwrong with memory contexts or anything other than that copy/paste error. 

> Alternatively you can declare one set of polymorphic
> functions and aggregates, in which case you'll need to closely
> study the stuff about the finalfunc_extra option [2].

Thanks for the tips, I have been eyeing that documentation.

— m@


pgsql-general by date:

Previous
From: Дмитрий Иванов
Date:
Subject: Re: Best Strategy for Large Number of Images
Next
From: Markus Demleitner
Date:
Subject: SELECT DISTINCT scans the table?