Re: ALTER EXTENSION UPGRADE, v3

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: ALTER EXTENSION UPGRADE, v3
Дата
Msg-id 4254.1297371534@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: ALTER EXTENSION UPGRADE, v3  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: ALTER EXTENSION UPGRADE, v3  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Thu, Feb 10, 2011 at 3:02 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> The design as I sketched it didn't need to make any assumptions at all
>> about the meaning of the version identifiers. �But if you were willing
>> to assume that the identifiers are comparable/sortable by some rule,

> You don't need them to be sortable.  You just need them to be
> comparable, and equality seems like a plenty good enough comparison
> rule.  You can compute the shortest chain of upgrade scripts that can
> take you from the current version to the target version.

Hmm.  The problem with that is that once there are large numbers of
intermediate versions, the number of potential paths grows
exponentially.  I was envisioning an algorithm like this:

1.  Scan directory for upgrade scripts with oldversion = version we
have, and take the one with largest newversion <= version we want.

2.  Apply this script (or more likely, just remember it until we've
verified there is a chain leading to version we want).

3.  If now the version is not what we want, return to step 1.

I don't see an equally efficient method if we only have equality.
        regards, tom lane


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: ALTER EXTENSION UPGRADE, v3
Следующее
От: Dimitri Fontaine
Дата:
Сообщение: Re: ALTER EXTENSION UPGRADE, v3