Re: ALTER EXTENSION UPGRADE, v3 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ALTER EXTENSION UPGRADE, v3
Date
Msg-id 15959.1297451759@sss.pgh.pa.us
Whole thread Raw
In response to Re: ALTER EXTENSION UPGRADE, v3  (Kääriäinen Anssi <anssi.kaariainen@thl.fi>)
Responses Re: ALTER EXTENSION UPGRADE, v3  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
Re: ALTER EXTENSION UPGRADE, v3  (marcin mank <marcin.mank@gmail.com>)
List pgsql-hackers
Kääriäinen Anssi <anssi.kaariainen@thl.fi> writes:
> This has the side effect that you can also have downgrade scripts. I
> don't know if this is designed or just coincidental, so thought it
> would be worth mentioning.

Yeah, that's intentional and IMO worth supporting.

We do have to be sure that the chain-finding algorithm doesn't choke on
loops in the graph, but AFAICS Dijkstra's algorithm doesn't have a
problem with that.  As long as we consider that each step has positive
cost, it won't execute a loop.

> The worst case is that if you are upgrading from 1.2 to 2.0 the path
> is 1.2 -> 1.1 -> 2.0, even if there exists a path 1.2 -> 1.8 -> 1.9 ->
> 2.0. This could potentially result in data loss, if the downgrade
> drops some columns or something like that.

Hmm.  That seems like it would require a rather pathological collection
of upgrade scripts.  In particular why would you have a one-step upgrade
from 1.1 to 2.0 but no short path from 1.2?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Range Types: empty ranges
Next
From: "Kevin Grittner"
Date:
Subject: Re: Range Types: empty ranges