RE: [PATCH] Support % wildcard in extension upgrade filenames
Regina Obe <lr@pcorp.us>
From: "Regina Obe" <lr@pcorp.us>
To: <strk@kbt.io>, "'Mat Arye'" <mat@timescaledb.com>
Cc: "'Yurii Rashkovskii'" <yrashk@gmail.com>, "'Tom Lane'" <tgl@sss.pgh.pa.us>, "'Regina Obe'" <r@pcorp.us>, <pgsql-hackers@lists.postgresql.org>
Date: 2023-04-28T12:10:00Z
Lists: pgsql-hackers
> > > As for Tom's concern about downgrades, I think it's valid but it's a > > case that is easy to test for in Plpgsql and either handle or error. > > For example, we use semver so testing for a downgrade at the top of > > the upgrade script is trivial. > I was thinking about this more. The extension model as it stands doesn't allow an extension author to define version hierarchy. We handle this internally in our scripts to detect a downgrade attempt and stop it similar to what Mat is saying. Most of that is basically converting our version string to a numeric number which we largely do with a regex pattern. I was thinking if there were some way to codify that regex pattern in our control file, then wild cards can only be applied if such a pattern is defined and the %--<target version> The % has to be numerically before the target version. Thanks, Regina