Search Postgresql Archives

Re: array_cat in PG-14 changed signature breaks my custom aggregate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 24 May 2021 at 20:53, Andreas Joseph Krogh <andreas@xxxxxxxxxx> wrote:
>
> Hi, I have this, for historical reasons:
>
> CREATE AGGREGATE array_aggarray(anyarray) (
>     SFUNC = array_cat, STYPE = anyarray);
>
>
> ...which now breaks in pg-14b1:
>
> ERROR:  function array_cat(anyarray, anyarray) does not exist
>
>
> I see the argument data-types have changed from anyarray to anycompatiblearray, but that doesn't really tell me anything.
>
> Do I have to change the signature of my aggregate to take anycompatiblearray as argument?

Yeah you'll need to do that or write your own transition function that
takes an anyarray.  The docs mention:

"the sfunc must take N+1 arguments, the first being of type state_data_type"

array_cat no longer takes anyarray.

regression=# \dfS array_cat
                                      List of functions
   Schema   |   Name    |  Result data type  |          Argument data
types           | Type
------------+-----------+--------------------+----------------------------------------+------
 pg_catalog | array_cat | anycompatiblearray | anycompatiblearray,
anycompatiblearray | func
(1 row)

This was changed in [1].

David

[1] https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=9e38c2bb5093ceb0c04d6315ccd8975bd17add66





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux