Re: Properly handling aggregate in nested function call
От | Matt Magoffin |
---|---|
Тема | Re: Properly handling aggregate in nested function call |
Дата | |
Msg-id | AF8238C6-E34C-452E-8718-D90BB5E231E2@msqr.us обсуждение исходный текст |
Ответ на | Re: Properly handling aggregate in nested function call (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Properly handling aggregate in nested function call
|
Список | pgsql-general |
On 15/12/2021, at 11:51 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
You shouldprobably palloc temp arrays right here and then use construct_md_array
directly instead of dealing with an ArrayBuildState.
OK, I gave that a go [1] this time in a vec_agg_sum() aggregate, that operates much the same as the vec_agg_mean() one and is behaving in the same way. For example this shows the correct values:
SELECT vec_agg_sum(nums) FROM measurements;
NOTICE: sum 0 = 4.92
NOTICE: sum 1 = 5.91
NOTICE: sum 2 = 14.80
vec_agg_sum
-------------------
{4.92,5.91,14.80}
(1 row)
But adding unnest() goes back to seemingly memory address values:
SELECT unnest(vec_agg_sum(nums)) FROM measurements;
NOTICE: sum 0 = 4.92
NOTICE: sum 1 = 5.91
NOTICE: sum 2 = 14.80
unnest
----------------
94069010663032
94069010663044
94069010663056
(3 rows)
Any other ideas I could look into?
— m@
В списке pgsql-general по дате отправления: