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 1kMaRq-0007Am-JE for pgsql-general@arkaria.postgresql.org; Sun, 27 Sep 2020 17:26:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kMaRn-0007nB-SR for pgsql-general@arkaria.postgresql.org; Sun, 27 Sep 2020 17:26:51 +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 1kMaRm-0007kQ-6l for pgsql-general@lists.postgresql.org; Sun, 27 Sep 2020 17:26:51 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kMaRd-0001cl-63 for pgsql-general@lists.postgresql.org; Sun, 27 Sep 2020 17:26:49 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 63CC7536; Sun, 27 Sep 2020 13:26:36 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 27 Sep 2020 13:26:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:from:to:cc:references:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=I IytG8nv47B+Rxbnv91/OdNGf9zPHFCSyVnc43mNbFQ=; b=NvROy3L9ahLANJ5V2 L9GIcmQBjzMShk4JcDeQzgegb1ShS6WypqH/sU+L6kFEO9Ez6BO1JTe8gtMdnihF +2HA85Us2mTrvhbS/nLvYAjJYP7qBNN82I6CWnspXi09hkZ+Ae3ArAzxsqPGhHWP APJ9SSa9mf8hpotOvDXU6Qylwmv1Ne+s9GS8kzguRER+6muUYcH2TrUWeJ2fqW5E 4MArHXcb3+BZKXuaA41g4bNCR7D2gfmAQBA4wBcXX9rmoppFEnlTyiZq4OPTlKq9 a7Vs0QWksKNgU1Hh+sBmGOCtRiHLuCad6BsqGO+HBdcWeQfJod6un9ypmnRhJK+z ljsag== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=IIytG8nv47B+Rxbnv91/OdNGf9zPHFCSyVnc43mNb FQ=; b=kNhsbz26R2Hvn6sXqfMJ0qhYCY3xmpxzNt0sD5e0tm+deJCdoWQ0ptsF5 DfxXIG9pRXeuPdgayfWqfcXcfktXylXBiveNRSrWgqHpqZfBYGpA0udeisaobaT2 z1oqEeUOYqdEYXpeFIyt93aziM+xvIMlX98f+OudWBGE+Z+SQMU4hqMll2NJAEht wDVFDU/1+ntK2AMKje2cqYPfZp9anTo+IM9lnPm+BRVA6Ut0Vqh2MAnJRgNEVQkg cdzf3TbpDff4fHaKYYuHG+Lz+p7nvWRAdjdEOXrVZjDNIzKaokOm81LhwK3SRFk2 aPcNLyH+kzT9FNhqQ6PsdlyTGV9RA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvdeggdduudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffhvfhfkffffgggjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeffkeffudefudffvefhkeekveekfedtvdetvdetieek uddvhedvteehjeefjefhudenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgne cukfhppeejhedrudejvddrhedrvdefudenucevlhhushhtvghrufhiiigvpedtnecurfgr rhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrd gtohhm X-ME-Proxy: Received: from [192.168.1.3] (75-172-5-231.tukw.qwest.net [75.172.5.231]) by mail.messagingengine.com (Postfix) with ESMTPA id 3DDC43280059; Sun, 27 Sep 2020 13:26:35 -0400 (EDT) Subject: Re: pg_upgrade Python version issue on openSUSE From: Adrian Klaver To: Tom Lane , =?UTF-8?Q?Paul_F=c3=b6rster?= Cc: PostgreSQL General References: <553A044A-D0E3-475D-8DC0-5845381CB086@gmail.com> <1FB046FC-BE42-4D66-B0AE-E94B6CB9498E@gmail.com> <06317862-1908-48C7-8766-F6D1B4BFEB9F@gmail.com> <1990004.1601129252@sss.pgh.pa.us> <9D64B513-77D4-41D9-87E5-0727FAF96C84@gmail.com> <1999120.1601131766@sss.pgh.pa.us> Message-ID: Date: Sun, 27 Sep 2020 10:26:34 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 9/26/20 8:07 AM, Adrian Klaver wrote: > On 9/26/20 7:49 AM, Tom Lane wrote: >> =?utf-8?Q?Paul_F=C3=B6rster?= writes: >>> On 26. Sep, 2020, at 16:07, Tom Lane wrote: >>>> However, I don't understand how "drop extension plpythonu" >>>> worked for you, given your previous query showing that >>>> that extension wasn't installed. >> >>> just checked with another 12.4. It's the same: >> >>> postgres=# select * from pg_available_extension_versions where >>> installed; >>>    name   | version | installed | superuser | relocatable | >>> schema   | requires |                           comment >>> ---------+---------+-----------+-----------+-------------+------------+----------+-------------------------------------------------------------- >>> >>>   plperlu | 1.0     | t         | t         | f           | >>> pg_catalog |          | PL/PerlU untrusted procedural language >>>   dblink  | 1.2     | t         | t         | t >>> |            |          | connect to other PostgreSQL databases from >>> within a database >>>   plpgsql | 1.0     | t         | f         | f           | >>> pg_catalog |          | PL/pgSQL procedural language >>>   plperl  | 1.0     | t         | f         | f           | >>> pg_catalog |          | PL/Perl procedural language >>> (4 rows) >> >>> postgres=# drop extension plpythonu ; >>> DROP EXTENSION >>> postgres=# create extension plpython3u ; >>> CREATE EXTENSION >> >> Actually, now that I think about it, you're querying the wrong view. >> I'm too lazy to check the source code right now, but I'm pretty sure >> that pg_available_extension_versions is mostly driven off what control >> files exist in the on-disk libdir.  But that may have little to do with >> what's in the system catalogs.  You should have checked pg_extension, >> or just "\dx" in psql. > > I believe the issue is here: > > select * from pg_pltemplate ; > > >  plpythonu  | f           | f             | plpython_call_handler  | > plpython_inline_handler  | plpython_validator  | $libdir/plpython2 | NULL >  plpython2u | f           | f             | plpython2_call_handler | > plpython2_inline_handler | plpython2_validator | $libdir/plpython2 | NULL >  plpython3u | f           | f             | plpython3_call_handler | > plpython3_inline_handler | plpython3_validator | $libdir/plpython3 | NULL > Some digging in the pg_upgrade code(function.c) proved the above wrong. Turns out pg_upgrade uses information from pg_proc. > > The default plpython is plpythonu and that points at $libdir/plpython2. > > The instructions here: > > https://www.postgresql.org/docs/12/plpython-python23.html > > offer a work around: > > "Daredevils, who want to build a Python-3-only operating system > environment, can change the contents of pg_pltemplate to make plpythonu > be equivalent to plpython3u, keeping in mind that this would make their > installation incompatible with most of the rest of the world." > > >> >>             regards, tom lane >> >> > > -- Adrian Klaver adrian.klaver@aklaver.com