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 1o4puq-0007Z9-UT for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Jun 2022 20:28:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o4pup-0001Bc-ER for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Jun 2022 20:28:31 +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 1o4puo-0001BT-Ri for pgsql-hackers@lists.postgresql.org; Fri, 24 Jun 2022 20:28:31 +0000 Received: from mail-io1-xd29.google.com ([2607:f8b0:4864:20::d29]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o4pul-0000Di-12 for pgsql-hackers@lists.postgresql.org; Fri, 24 Jun 2022 20:28:29 +0000 Received: by mail-io1-xd29.google.com with SMTP id h85so3857635iof.4 for ; Fri, 24 Jun 2022 13:28:26 -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=fCpuRoK31LPTFqxmGACl6xE/PCTDLZASRpttyFet4JE=; b=Whl3wLLsg9Zmwv1NuQdbUFTVJlbgZymMLZuJ/or5Q9bjAZ+dIIIHDuDTiunLF54nxQ by2C7cBX0rEW3KmZ2A3rgPYAe1UR+O4goIx3kGrqZ5ksVnuH/hccXLcrmt29CmHK9Ftb kLrt1Ocgdf3trL+xWlo0YFeVjd9JfONKrty0v1dHeZ8mWQkEajYPc7Igfq6CNmGuKR4e vjY4mv+AqbDYpZZuEYlFDaY8eBnhUuWUZwvrX1La9u8ZaRcb84EVPI/sVgukDtFmezhK zDXRW/5iRDirnzZ7r2sMZBlTqquNwi6TkgPqgWVEw1qa+BEhib6xIBfyhb1c1IWYkIQp 8Lxw== 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=fCpuRoK31LPTFqxmGACl6xE/PCTDLZASRpttyFet4JE=; b=Qc6DjEMHi0hiS0BT5zpHVET/Owmw6Ga1otQByNFZjr3Pc4iv2pEa7x4EPkUyJD6jB3 tysM/sCLrHaj0YKpbSPAo/rDEJxTOLAwMB2qpgEh9v5O9eW/YcZA029mZVDC9HHIp28L +LOADOMg131emwsXdWrfsf/kTiYAu5G0BJDXpAj7s9ANfJI26mmdOEKPLYyV6gXGHZvR lD43yLJlHM4M7is7F7YGETQFzzDc0z2lu5/PKlfwWrZpMMKPa4pYtxmA3EMVWRBQGz0M TzNRB36jQAD7WyHk7CnFw60IiKyMKYqnF8WGDN++kinm9KJN87TzxsjpCGTUEoGQo/5c uuUA== X-Gm-Message-State: AJIora/smJPkYmmsBydMqO35js5k1EfOXNC3klHF8jw4bZpjSnqi2j32 4eLq9qef1C7eGGIcA50t/VQSvg== X-Google-Smtp-Source: AGRyM1vGGIBHAgiiMClRWKiHV0vpKbArVeM0JRLq6MlaiiR2R/+6mlYOfxrbL9qL/XPmYyYCoqftpA== X-Received: by 2002:a05:6638:25cd:b0:332:109a:fac with SMTP id u13-20020a05663825cd00b00332109a0facmr629704jat.70.1656102506054; Fri, 24 Jun 2022 13:28:26 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id q7-20020a92c007000000b002d9cbf142cfsm1419913ild.68.2022.06.24.13.28.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jun 2022 13:28:25 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 763238008DE; Fri, 24 Jun 2022 15:28:24 -0500 (CDT) Date: Fri, 24 Jun 2022 15:28:24 -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: <20220624202824.GF22452@telsasoft.com> References: <3383880.QJadu78ljV@vejsadalnx> <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> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="2uzDqHpccQJpqF2n" Content-Disposition: inline In-Reply-To: <33211367-6CAF-4B09-AA0E-020C62FAD8EF@yandex-team.ru> 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 --2uzDqHpccQJpqF2n Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Jun 24, 2022 at 11:43:18PM +0500, Andrey Borodin wrote: > > On 23 Jun 2022, at 04:58, Justin Pryzby wrote: > > > > On Fri, Jun 17, 2022 at 10:14:13AM -0400, Tom Lane wrote: > >> Robert Haas writes: > >>> On Thu, Jun 16, 2022 at 10:01 PM Justin Pryzby wrote: > >>>> To me, oid>=16384 seems more hard-wired than namespace!='pg_catalog'. > >> > >>> Extensions can be installed into pg_catalog, but they can't get > >>> low-numbered OIDs. > >> > >> Exactly. (To be clear, I had in mind writing something involving > >> FirstNormalObjectId, not that you should put literal "16384" in the > >> code.) > > > > Actually, 16384 is already used in two other places in check.c, so ... > > Yes, but it's a third copy of the comment ("* The query below hardcodes FirstNormalObjectId as 16384 rather than") across the file. > > Also, we can return slightly more information about found objects. For example, operator will look like "operator: ||". At least we can get nspname and oid. And, maybe return type for aggregator and leftarg\rightarg types for operator? But what I wrote already shows what you want. In database: postgres aggregate: public.array_accum(anyelement) operator: public.!@#(anyarray,anyelement) In my testing, this works great - it shows what you need to put in your DROP command. If you try it and still wanted the OID, I'll add it for consistency with check_for_user_defined_{encoding_conversions,postfix_ops} > BTW comment /* Before v11, used proisagg=true, and afterwards uses prokind='a' */ seems interesting, but irrelevant. We join with pg_aggregate anyway. Yes, that's why the query doesn't need to include that. Something is broken in my old clusters and I can't test all the upgrades right now, but this is my latest. --2uzDqHpccQJpqF2n Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-WIP-pg_upgrade-check-detect-old-polymorphics-from-pr.patch"