Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oM5Fo-0006h4-GP for pgsql-bugs@arkaria.postgresql.org; Thu, 11 Aug 2022 10:17:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oM5Fn-00041O-AD for pgsql-bugs@arkaria.postgresql.org; Thu, 11 Aug 2022 10:17:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oM5Fn-00041E-08 for pgsql-bugs@lists.postgresql.org; Thu, 11 Aug 2022 10:17:27 +0000 Received: from mxe1.seznam.cz ([2a02:598:a::78:34]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oM5Fj-0002s8-Uu for pgsql-bugs@lists.postgresql.org; Thu, 11 Aug 2022 10:17:25 +0000 Received: from email.seznam.cz by email-smtpc26b.ko.seznam.cz (email-smtpc26b.ko.seznam.cz [10.53.18.37]) id 0e8718c7b4806acd0e951341; Thu, 11 Aug 2022 12:17:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seznam.cz; s=beta; t=1660213039; bh=Xcme8Sv/6jxWdfL5mX2f6PtSU38uKgEx/S+RQwbM2qU=; h=Received:From:To:Cc:Subject:Date:Message-Id:References: Mime-Version:X-Mailer:Content-Type; b=d+uBAsJIyowZo6nRxQV2bwILCBqS/FrJD1edkx3hg40qiYBHj7VCpZKBVgp3rMckb SuTIlkgS1JtqY/Q/bVlbsJLwxO0O3LhXBl2kkICTUsscSNbAiiJ7Dm90uNRxri+vyA div23Hd+SYLqgBT3cQSNPt1V8IPINAAzfG/1Arxo= Received: from unknown ([2a02:8304:2:3:2f16:4908:c73f:70bc]) by email.seznam.cz (szn-ebox-5.0.117) with HTTP; Thu, 11 Aug 2022 12:17:10 +0200 (CEST) From: =?utf-8?q?David_Turo=C5=88?= To: "Tom Lane" Cc: , "PostgreSQL mailing lists" , "David G. Johnston" Subject: =?utf-8?q?Re=3A_BUG_=2317206=3A_the_function_array=5Fcat=28anyarr?= =?utf-8?q?ay=2C_anyarray=29_does_not_exist?= Date: Thu, 11 Aug 2022 12:17:10 +0200 (CEST) Message-Id: <13T.5{S3.6C2WnHnPYu}.1YzDSc@scif.cz> References: <17206-f0a6b77a0a7b8499@postgresql.org> <3266664.1633045937@sss.pgh.pa.us> Mime-Version: 1.0 (szn-mime-2.1.21) X-Mailer: szn-ebox-5.0.117 Content-Type: multipart/alternative; boundary="=_34294e454b788b910556f2bd=33108365-3c81-5ccc-bd67-b51940fc4c4f_=" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --=_34294e454b788b910556f2bd=33108365-3c81-5ccc-bd67-b51940fc4c4f_= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, anycompatible didn't accept anyarray. Example from=C2=A0system catalogs:= SELECT most_common_freqs[ =C2=A0 =C2=A0 array_position(most_common_vals::text::text[],'range_ops'::t= ext) ] * 100 AS occurrence_percent=C2=A0=C2=A0 FROM pg_stats=C2=A0 WHERE schemaname=3D'pg_catalog' AND tablename =3D'pg_opfamily' AND attname= =3D 'opfname'; =C2=A0occurrence_percent=C2=A0 -------------------- =C2=A02.7397260069847107 must be cast to text::text[] without cast: ERROR:=C2=A0 function array_position(anyarray, text) does not exist Is bug that function with anycompatiblearray didn't accept anyarray data = type?=C2=A0 regards,=C2=A0David Turo=C5=88 ---------- P=C5=AFvodn=C3=AD e-mail ---------- Od: Tom Lane Komu: David G. Johnston Kopie: edouard.hibon@free.fr, PostgreSQL mailing lists Datum: 11. 8. 2022 12:02:17 P=C5=99edm=C4=9Bt: Re: BUG #17206: the function array_cat(anyarray, anyarr= ay) does not exist ""David G. Johnston" writes: > On Thu, Sep 30, 2021 at 2:51 PM PG Bug reporting form < > noreply@postgresql.org> wrote: >> I get the ERROR : the function array_cat(anyarray, anyarray) does not = >> exist, > You may find this commit to be illuminating. Work was done in this area = > for v14. > https://github.com/postgres/postgres/commit/97f73a978fc1aca59c6ad765548c= e 0096d95a923 This one might be more so: https://git.postgresql.org/gitweb/?p=3Dpostgresql.git&a=3Dcommitdiff&h=3D9= e38c2bb 50 Also see the very first item in the v14 compatibility notes: User-defined objects that reference certain built-in array functions along with their argument types must be recreated (Tom Lane) Specifically, array_append(), array_prepend(), array_cat(), array_position(), array_positions(), array_remove(), array_replace(), and width_bucket() used to take anyarray arguments but now take anycompatiblearray. Therefore, user-defined objects like aggregates and operators that reference those array function signatures must be dropped before upgrading, and recreated once the upgrade completes. regards, tom lane " --=_34294e454b788b910556f2bd=33108365-3c81-5ccc-bd67-b51940fc4c4f_= Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi,

anycompatible didn't accept anyarray. E= xample from system catal= ogs:
=
SELECT most_common_freqs[
    arra= y_position(most_common_vals::text::text[],'range_ops'::text)
] *= 100 AS occurrence_percent  
FROM pg_stats 
=
WHERE schemaname=3D'pg_catalog' AND tablename =3D'pg_opfamily' AND at= tname=3D'opfname';
 occurrence_percent 
----= ----------------
 2.7397260069847107


must be cast to text::text[] without cast:
ERROR:  function array_position(anyarray, text) does not exist
=

Is bug that function with anycompatiblearray did= n't accept anyarray data type? 

regards,&nbs= p;David Turo=C5=88


"David G. Johnston" <david.g.johnston@gmail.com> writes:=0A=
> On Thu, Sep 30, 2021 at 2:51 PM PG Bug reporting form <=0A=
> noreply@postgresql.org> wrote:=0A=
>> I get the ERROR : the function array_cat(anyarray, anyarray) = does not=0A=
>> exist,=0A=
=0A=
> You may find this commit to be illuminating. Work was done in th= is area=0A=
> for v14.=0A=
> https://github.com/postgres/postgres/commit/97f73a978fc1aca59c6ad= 765548ce0096d95a923=0A=
=0A=
This one might be more so:=0A=
=0A=
https://git.postgresql.org/gitweb/?p=3Dpostgresql.git&a=3Dcommitdi= ff&h=3D9e38c2bb50=0A=
=0A=
Also see the very first item in the v14 compatibility notes:=0A=
=0A=
User-defined objects that reference certain built-in array functio= ns=0A=
along with their argument types must be recreated (Tom Lane)=0A=
=0A=
Specifically, array_append(), array_prepend(), array_cat(),=0A=
array_position(), array_positions(), array_remove(), array_replace= (),=0A=
and width_bucket() used to take anyarray arguments but now take= =0A=
anycompatiblearray. Therefore, user-defined objects like aggregate= s=0A=
and operators that reference those array function signatures must = be=0A=
dropped before upgrading, and recreated once the upgrade completes= .=0A=
=0A=
regards, tom lane=0A=
=0A=
=0A=
=0A=
=0A=
--=_34294e454b788b910556f2bd=33108365-3c81-5ccc-bd67-b51940fc4c4f_=--