Re: ALTER EXTENSION UPGRADE, v3

Поиск
Список
Период
Сортировка
От David E. Wheeler
Тема Re: ALTER EXTENSION UPGRADE, v3
Дата
Msg-id 904C5A1F-D3D0-47E8-816F-9F7A1435E3BA@kineticode.com
обсуждение исходный текст
Ответ на Re: ALTER EXTENSION UPGRADE, v3  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
Ответы Re: ALTER EXTENSION UPGRADE, v3  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
Re: ALTER EXTENSION UPGRADE, v3  (Aidan Van Dyk <aidan@highrise.ca>)
Re: ALTER EXTENSION UPGRADE, v3  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Feb 2, 2011, at 9:19 AM, Dimitri Fontaine wrote:

> I see there no solution to your reaction here.  Please take the time to
> tell us more about what exactly it is that you hated, and how to make it
> lovely.  We won't make any progress with your current commenting style.

Here is your example of the two upgrade scripts:

> Now, the upgrade script from version NULL to 1.0 is
>
> alter domain @extschema@.lo set extension lo;
> alter function @extschema@.lo_oid(lo) set extension lo;
> alter function @extschema@.lo_manage() set extension lo;
>
> The upgrade script from version 1.0 to 2.0 is, let's say:
>
> CREATE OR REPLACE FUNCTION @extschema@.lo_newfunc() …
>
> So the upgrade script from version NULL to 2.0 is:
>
> alter domain @extschema@.lo set extension lo;
> alter function @extschema@.lo_oid(lo) set extension lo;
> alter function @extschema@.lo_manage() set extension lo;
> CREATE OR REPLACE FUNCTION @extschema@.lo_newfunc() …

They are identical except for the extra line in the second one. If I had, say 15 different versions of an extension,
thenI'd have 15 upgrade scripts. That's fine. But in your plan, the script to upgrade from version 1 to version 15
wouldhave all the same code as the v14 script, plus any additional. The v14 script would have everything in v13. v13
wouldhave everything in v12. With no support for the equivalent of psql's \i, that's extremely redundant and a huge
PITAto maintain. Hence my hate. 

My proposal would also have 15 upgrade scripts, but each one would only upgrade from the previous one. So to upgrade
fromv1 to v15, UPGRADE EXTENSION would run all of them. So v15 would only need to have deltas from v14. V14 would need
onlydeltas from v13. Etc. 

The number of upgrade script files is not the problem I have. It's the redundant content of those files that raises my
ire.

If there was some way to get something like \i in your approach, that would satisfy me, as it would be only an extra
line(at most) in each script. And then, as you note, the core wouldn't need the complexity of understanding version
numbers,which I agree would be beneficial. 

Best,

David



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

Предыдущее
От: Dimitri Fontaine
Дата:
Сообщение: Re: ALTER EXTENSION UPGRADE, v3
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: SSI patch version 14