pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Kellerer <shammat@gmx.net>
Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: pg_upgrade(?) not cleaning up old extensions
Date: Sat, 06 Feb 2021 12:09:04 -0500
Message-ID: <191204.1612631344@sss.pgh.pa.us> (raw)
In-Reply-To: <61ea1e0b-442d-e6c8-1728-916f8376aa11@gmx.net>
References: <61ea1e0b-442d-e6c8-1728-916f8376aa11@gmx.net>

Thomas Kellerer <shammat@gmx.net> writes:
> I have noticed that when I look at pg_available_extensions many extensions are listed with multiple versions even though only the latest one is actually 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





view thread (6+ messages)  latest in thread

Message-ID: <191204.1612631344@sss.pgh.pa.us>
Permalink:  ../191204.1612631344@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/191204.1612631344@sss.pgh.pa.us

 · 

reply

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-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, shammat@gmx.net, pgsql-admin@lists.postgresql.org
  Subject: Re: pg_upgrade(?) not cleaning up old extensions
  In-Reply-To: <191204.1612631344@sss.pgh.pa.us>

* 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