aggregate array broken in postgresql 15.

Started by aliasalmost 4 years ago3 messages
#1alias
postgres.rocks@gmail.com

https://github.com/postgres/postgres/commit/97f73a978fc1aca59c6ad765548ce0096d95a923?diff=split
https://dbfiddle.uk/?rdbms=postgres_14&fiddle=11a30590cb376a24df172198139d758e

select version();

version

------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PostgreSQL 15devel (Ubuntu
15~~devel~20220329.1030-1~680.git8cd7627.pgdg20.04+1) on
x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0,
64-bit
(1 row)

(END)
----------------

create or replace aggregate array_agg_mult(anycompatiblearray) (
sfunc = array_cat,
stype = anycompatiblearray,
initcond = '{}'
);
SELECT array_agg_mult(i)
FROM (VALUES (ARRAY[row(1,2),row(3,4)]), (ARRAY[row(5,6),row(7,8)])) as t(i);

ERROR: 42725: function array_agg_mult(record[]) is not unique
LINE 1: SELECT array_agg_mult(i)
^
HINT: Could not choose a best candidate function. You might need to add
explicit type casts.
LOCATION: ParseFuncOrColumn, parse_func.c:570
Time: 1.292 ms

I installed postgresql 15, one week ago.
How to solve the above mentioned problem. Or since it was solved last week,
I need to update postgresql?

#2Pavel Stehule
pavel.stehule@gmail.com
In reply to: alias (#1)
Re: aggregate array broken in postgresql 15.

Hi

čt 7. 4. 2022 v 12:30 odesílatel alias <postgres.rocks@gmail.com> napsal:

https://github.com/postgres/postgres/commit/97f73a978fc1aca59c6ad765548ce0096d95a923?diff=split

https://dbfiddle.uk/?rdbms=postgres_14&amp;fiddle=11a30590cb376a24df172198139d758e

select version();

version

------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PostgreSQL 15devel (Ubuntu
15~~devel~20220329.1030-1~680.git8cd7627.pgdg20.04+1) on
x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0,
64-bit
(1 row)

(END)
----------------

create or replace aggregate array_agg_mult(anycompatiblearray) (
sfunc = array_cat,
stype = anycompatiblearray,
initcond = '{}'
);
SELECT array_agg_mult(i)
FROM (VALUES (ARRAY[row(1,2),row(3,4)]), (ARRAY[row(5,6),row(7,8)])) as t(i);

ERROR: 42725: function array_agg_mult(record[]) is not unique
LINE 1: SELECT array_agg_mult(i)
^
HINT: Could not choose a best candidate function. You might need to add
explicit type casts.
LOCATION: ParseFuncOrColumn, parse_func.c:570
Time: 1.292 ms

I tested your code on my clean pg 15 without any problem

Maybe you have an array_agg_mult with anyarray argument. If yes, then you
have to drop this aggregate function.

Regards

Pavel

Show quoted text

I installed postgresql 15, one week ago.
How to solve the above mentioned problem. Or since it was solved last
week, I need to update postgresql?

#3alias
postgres.rocks@gmail.com
In reply to: Pavel Stehule (#2)
Re: aggregate array broken in postgresql 15.

my mistake. I don't know that aggregate can also overload. problem
solved....

On Thu, Apr 7, 2022 at 4:09 PM Pavel Stehule <pavel.stehule@gmail.com>
wrote:

Show quoted text

Hi

čt 7. 4. 2022 v 12:30 odesílatel alias <postgres.rocks@gmail.com> napsal:

https://github.com/postgres/postgres/commit/97f73a978fc1aca59c6ad765548ce0096d95a923?diff=split

https://dbfiddle.uk/?rdbms=postgres_14&amp;fiddle=11a30590cb376a24df172198139d758e

select version();

version

------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PostgreSQL 15devel (Ubuntu
15~~devel~20220329.1030-1~680.git8cd7627.pgdg20.04+1) on
x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0,
64-bit
(1 row)

(END)
----------------

create or replace aggregate array_agg_mult(anycompatiblearray) (
sfunc = array_cat,
stype = anycompatiblearray,
initcond = '{}'
);
SELECT array_agg_mult(i)
FROM (VALUES (ARRAY[row(1,2),row(3,4)]), (ARRAY[row(5,6),row(7,8)])) as t(i);

ERROR: 42725: function array_agg_mult(record[]) is not unique
LINE 1: SELECT array_agg_mult(i)
^
HINT: Could not choose a best candidate function. You might need to add
explicit type casts.
LOCATION: ParseFuncOrColumn, parse_func.c:570
Time: 1.292 ms

I tested your code on my clean pg 15 without any problem

Maybe you have an array_agg_mult with anyarray argument. If yes, then you
have to drop this aggregate function.

Regards

Pavel

I installed postgresql 15, one week ago.
How to solve the above mentioned problem. Or since it was solved last
week, I need to update postgresql?