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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCH] Support % wildcard in extension upgrade filenames
Дата
Msg-id 3069230.1653752250@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [PATCH] Support % wildcard in extension upgrade filenames  (Laurenz Albe <laurenz.albe@cybertec.at>)
Ответы Re: [PATCH] Support % wildcard in extension upgrade filenames
Re: [PATCH] Support % wildcard in extension upgrade filenames
Список pgsql-hackers
Laurenz Albe <laurenz.albe@cybertec.at> writes:
> I don't think this idea is fundamentally wrong, but I have two worries:

> 1. It would be a good idea good to make sure that there is not both
>    "extension--%--2.0.sql" and "extension--1.0--2.0.sql" present.
>    Otherwise the behavior might be indeterministic.

The existing logic to find multi-step upgrade paths is going to make
this a very pressing problem.  For example, if you provide both
extension--%--2.0.sql and extension--%--2.1.sql, it's not at all
clear whether the code would try to use both of those or just one
to get from 1.x to 2.1.

> 2. What if you have a "postgis--%--3.3.sql", and somebody tries to upgrade
>    their PostGIS 1.1 installation with it?  Would that work?
>    Having a lower bound for a matching version might be a good idea,
>    although I have no idea how to do that.

The lack of upper bound is a problem too: what stops the system from
trying to use this to get from (say) 4.2 to 3.3, and if it does try that,
will the script produce a sane result?  (Seems unlikely, as it couldn't
know what 4.x objects it ought to alter or remove.)  But it's going to be
very hard to provide bounds, because we intentionally designed the
extension system to not have an explicit concept of some versions being
less than others.

I'm frankly skeptical that this is a good idea at all.  It seems
to have come out of someone's willful refusal to use the system as
designed, ie as a series of small upgrade scripts that each do just
one step.  I don't feel an urgent need to cater to the
one-monster-script-that-handles-all-cases approach, because no one
has offered any evidence that that's really a better way.  How would
you even write the conditional logic needed ... plpgsql DO blocks?
Testing what?  IIRC we don't expose any explicit knowledge of the
old extension version number to the script.

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Daniel Gustafsson
Дата:
Сообщение: Re: Bump MIN_WINNT to 0x0600 (Vista) as minimal runtime in 16~
Следующее
От: Justin Pryzby
Дата:
Сообщение: CI and test improvements