RE: [PATCH] Support % wildcard in extension upgrade filenames

From: "Regina Obe" <lr(at)pcorp(dot)us>
To: <strk(at)kbt(dot)io>, <pgsql-hackers(at)postgresql(dot)org>, "'Laurenz Albe'" <laurenz(dot)albe(at)cybertec(dot)at>, "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: RE: [PATCH] Support % wildcard in extension upgrade filenames
Date: 2022-10-31 05:55:05
Message-ID: 000001d8eced$539c5bf0$fad513d0$
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Just to reiterate the main impetus for this patch is to save PostGIS from
shipping 100s of duplicate extension files for each release.

> And now with the actual patch attached ... (sorry)
> --strk;

Sandro, can you submit an updated version of this patch.
I was testing it out and looked good first time.

But I retried just now testing against master, and it fails with

commands/extension.o: In function `file_exists':
postgresql-git\src\backend\commands/extension.c:3430: undefined reference to

It seems 2 days ago AssertArg and AssertState were removed.;a=commit;h=b1099eca8f38f

So your use of AssertArg needs to be replaced with Assert I guess.
I did that and was able to test again with a sample extension I made



1) The wildcard patch in its current state only does anything if

wildcard_upgrades = true

is in the control file. If it's false or missing, then the behavior of
extension upgrades doesn't change.

2) It only understands % as a complete wildcard for a version number

So this is legal

This does nothing

3) I confirmed that if you have a path such as


then the exact match trumps the wildcard. In the above case if I am on 2.0
and going to 2.2, the wildtest--2.0--2.2.sql script is used instead of the
wildtest--% one.

4) It is not possible to downgrade with the wildcard. For example I had

and I was unable to go from a version 2.2 down to a version 2.1. I didn't
check why that was so, but probably a good thing.

If everyone is okay with this patch, we'll go ahead and add tests and
documentation to go with it.


In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2022-10-31 06:05:44 Re: Adding doubly linked list type which stores the number of items in the list
Previous Message Masahiko Sawada 2022-10-31 05:46:53 Re: [PoC] Improve dead tuple storage for lazy vacuum