From: David Turoň <Turon.David@seznam.cz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: edouard.hibon@free.fr
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Subject: Re: BUG #17206: the function array_cat(anyarray, anyarray) does not exist
Date: Thu, 11 Aug 2022 12:17:10 +0200 (CEST)
Message-ID: <13T.5{S3.6C2WnHnPYu}.1YzDSc@scif.cz> (raw)
References: <CAKFQuwbKPYOuaexih1fMDPKa7kTjLSVjNdWCRHn7iJ2+oukpHg@mail.gmail.com>
<17206-f0a6b77a0a7b8499@postgresql.org>
<3266664.1633045937@sss.pgh.pa.us>
Hi,
anycompatible didn't accept anyarray. Example from system catalogs:
SELECT most_common_freqs[
array_position(most_common_vals::text::text[],'range_ops'::text)
] * 100 AS occurrence_percent
FROM pg_stats
WHERE schemaname='pg_catalog' AND tablename ='pg_opfamily' AND attname=
'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 didn't accept anyarray data
type?
regards, David Turoň
---------- Původní e-mail ----------
Od: Tom Lane <tgl@sss.pgh.pa.us>
Komu: David G. Johnston <david.g.johnston@gmail.com>
Kopie: edouard.hibon@free.fr, PostgreSQL mailing lists <pgsql-bugs@lists.
postgresql.org>
Datum: 11. 8. 2022 12:02:17
Předmět: Re: BUG #17206: the function array_cat(anyarray, anyarray) does not
exist
""David G. Johnston" <david.g.johnston@gmail.com> 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/97f73a978fc1aca59c6ad765548ce0096d95a923
This one might be more so:
https://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=9e38c2bb
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
"
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: Turon.David@seznam.cz, tgl@sss.pgh.pa.us, edouard.hibon@free.fr, pgsql-bugs@lists.postgresql.org, david.g.johnston@gmail.com
Subject: Re: BUG #17206: the function array_cat(anyarray, anyarray) does not exist
In-Reply-To: <13T.5{S3.6C2WnHnPYu}.1YzDSc@scif.cz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox