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 1l8R56-0000NL-Lf for pgsql-admin@arkaria.postgresql.org; Sat, 06 Feb 2021 17:09:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l8R55-00038v-JY for pgsql-admin@arkaria.postgresql.org; Sat, 06 Feb 2021 17:09:11 +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 1l8R55-00038o-Co for pgsql-admin@lists.postgresql.org; Sat, 06 Feb 2021 17:09:11 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l8R53-0000er-Oy for pgsql-admin@lists.postgresql.org; Sat, 06 Feb 2021 17:09:10 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 116H94IS191205; Sat, 6 Feb 2021 12:09:04 -0500 From: Tom Lane To: Thomas Kellerer cc: "pgsql-admin@lists.postgresql.org" Subject: Re: pg_upgrade(?) not cleaning up old extensions In-reply-to: <61ea1e0b-442d-e6c8-1728-916f8376aa11@gmx.net> References: <61ea1e0b-442d-e6c8-1728-916f8376aa11@gmx.net> Comments: In-reply-to Thomas Kellerer message dated "Sat, 06 Feb 2021 13:23:53 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <191203.1612631344.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 06 Feb 2021 12:09:04 -0500 Message-ID: <191204.1612631344@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thomas Kellerer writes: > I have noticed that when I look at pg_available_extensions many extensio= ns are listed with multiple versions even though only the latest one is ac= tually used. Yes, that view is supposed to list the versions that are available to be installed. Typically, installation scripts for several back versions exist on disk. This is an artifact of the way that we approach providing extension upgrade capability, but it can be handy if you want to test SQL code against back versions. As an example, contrib/adminpack installs adminpack--1.0.sql adminpack--1.0--1.1.sql adminpack--1.1--2.0.sql adminpack--2.0--2.1.sql Ordinarily, when you "create extension adminpack", it runs all four of those scripts in sequence and you end up with the 2.1 SQL objects. But if you ask to install some earlier version, it just stops after the appropriate script. So pg_available_extensions shows 1.0, 1.1, 2.0, and 2.1 as available versions. (Of course, the main reason for having the delta scripts is to support "alter extension upgrade".) regards, tom lane