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 1o5yBL-0002GG-EV for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Jun 2022 23:30:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o5yBI-000752-GZ for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Jun 2022 23:30:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o5yBI-00074r-2W for pgsql-hackers@lists.postgresql.org; Mon, 27 Jun 2022 23:30:12 +0000 Received: from mail-qv1-xf2a.google.com ([2607:f8b0:4864:20::f2a]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o5yBE-0000yy-KI for pgsql-hackers@lists.postgresql.org; Mon, 27 Jun 2022 23:30:11 +0000 Received: by mail-qv1-xf2a.google.com with SMTP id 2so2770246qvc.0 for ; Mon, 27 Jun 2022 16:30:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=c4WwsQWU5Yaj8GgRSoTn7QykCD2xKxlTVbd1XHbFKus=; b=zAA1hIaAx21cBQfT+iIFxbP2gf1Vejm6agx6degTe/DxgdtmCP5y/olQNM3DK3GIc0 tPY+8CVFAHL9pEoueJwGJWMNoupcEhRnzDIFEJrAxQ2k4pp+F8IgPy8vBNi5pPLp3kd8 Lftm6a3xlxDecKpbtZ+x94aPrlWk0Fe5Utc68TBSOUrBsEPJl/PCGtZpDanX/AhUdfwL OvmbY9gWiwgs4BkB9OehHN+ANBOqU9ZMBQbVjK09VJhAWefyAgh4nHUIpDjJEKALl8zz sO8Klr/qn26WK0p0H84TeIU1y+WRIIzanqUGHsRwgj0Cy/qN+dDoGqBQC3SO6/vhdu23 07fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=c4WwsQWU5Yaj8GgRSoTn7QykCD2xKxlTVbd1XHbFKus=; b=ttDmNVPDZTcBAvLL4fv/QqZ3ejLKwtiqAcc2E1plWWZbgIAgUYdC4Y+JsudhjWiwPM By7xwNV+Xb5Vv6hTGEMuvWcQcbauxH3sc6CAqJMKmIsEswV9+WRFY1+kF37/LYGBMSka rttc/KRS+OM+f/SPFOoCksK9CumryhI8+gHgckhnC+MSrS2s+XS3rdt/xXI1m0mx01zG gZveZusK8aXpLZUVbOfrEZVPz+eHVzrFsL9zyrBoKSF4benphcldF5jh0rUIZ85qqOfC 40EUkHyRlEnzOXB7w1rlMa9QV9coyqnGuPctZmP2fdG05azLEBfD+rmYZMy4Hutx6p5+ HRpQ== X-Gm-Message-State: AJIora9g7MlzA8bsUNTJPSnk9V0X0WMnCVxCK0uhTUMqjRl7sf8TsjCK 5008btYGTWDBS5mUzukeFoScAg== X-Google-Smtp-Source: AGRyM1ux55rizyD7HWx+mDBQ78iI5Fv2yZ5mJwBIGbQDmT6185EvHR8jWW3zMRW69bBc3AR9ARO19Q== X-Received: by 2002:ac8:57c1:0:b0:305:2a2f:f45 with SMTP id w1-20020ac857c1000000b003052a2f0f45mr11043392qta.609.1656372606200; Mon, 27 Jun 2022 16:30:06 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id cj20-20020a05622a259400b002f936bae288sm7908422qtb.87.2022.06.27.16.30.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Jun 2022 16:30:04 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id CD5878006D0; Mon, 27 Jun 2022 18:30:03 -0500 (CDT) Date: Mon, 27 Jun 2022 18:30:03 -0500 From: Justin Pryzby To: Andrey Borodin Cc: Tom Lane , Robert Haas , "David G. Johnston" , Petr Vejsada , pgsql-hackers@lists.postgresql.org Subject: Re: pg_upgrade (12->14) fails on aggregate Message-ID: <20220627233003.GE19662@telsasoft.com> References: <20220614230949.GX29853@telsasoft.com> <540147.1655321524@sss.pgh.pa.us> <20220617020103.GG29853@telsasoft.com> <1216673.1655475253@sss.pgh.pa.us> <20220622235845.GV22452@telsasoft.com> <33211367-6CAF-4B09-AA0E-020C62FAD8EF@yandex-team.ru> <20220624202824.GF22452@telsasoft.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ZfOjI3PrQbgiZnxM" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --ZfOjI3PrQbgiZnxM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Jun 25, 2022 at 03:34:49PM +0500, Andrey Borodin wrote: > > On 25 Jun 2022, at 01:28, Justin Pryzby wrote: > > > this is my latest. > > <0001-WIP-pg_upgrade-check-detect-old-polymorphics-from-pr.patch> > > Let's rename "databases_with_old_polymorphics.txt" to somthing like "old_polymorphics.txt" or maybe even "incompatible_polymorphics_usage.txt"? > I think you will come up with a better name, my point is here everythin is in "databases", and "old" doesn't describe essence of the problem. > Also, let's check that oid of used functions belong to system catalog (<16384)? We don't care about user-defined functions with the same name. Right now, we test =ANY(ARRAY['array_remove(anyarray,anyelement)',...]::regprocedure) ..which will find the system's array_remove, and not some other one, due to ALWAYS_SECURE_SEARCH_PATH_SQL (which is also why ::regprocedure prints a namespace for the non-system functions we're interested in displaying). I had "transnsp.nspname='pg_catalog'", which was redundant, so I removed it. I tested that this allows upgrades with aggregates on top of non-system functions of the same name/args: postgres=# CREATE FUNCTION array_append(anyarray, anyelement) RETURNS ANYARRAY LANGUAGE SQL AS $$ $$; postgres=# CREATE AGGREGATE foo(anyelement) (sfunc=public.array_append, stype=anyarray, initcond='{}'); > And, probably, we can do this unconditionally: > if (old_cluster.major_version >= 9500) > appendPQExpBufferStr(&old_polymorphics, > Nothing bad will happen if we blacklist usage of nonexistent functions. Nope, it's as I said: this would break pg_upgrade from older versions. > I realized that my latest patch would break upgrades from old servers, which do > not have array_position/s nor width_bucket, so ::reprocedure would fail. Maybe > Andrey's way is better (checking proname rather than its OID). This fixes several error with the version test. -- Justin --ZfOjI3PrQbgiZnxM Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-WIP-pg_upgrade-check-detect-old-polymorphics-from-pr.patch"