Re: ALTER EXTENSION UPGRADE, v3

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>, Robert Haas <robertmhaas(at)gmail(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: ALTER EXTENSION UPGRADE, v3
Date: 2011-02-11 00:02:31
Message-ID: CE4056F4-5731-41E6-90F6-81FD2627394E@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Feb 10, 2011, at 3:50 PM, Tom Lane wrote:

> It seems that we've mostly got consensus on the ideas of having a separate
> script file for each installable version of an extension, and for each
> basic version-upgrade action, with version numbers embedded in the file
> names so that the control files don't need to be involved in identifying
> what's what. And the core system is expected to be able to figure out how
> to chain upgrade scripts together when necessary. Therefore, I'm now
> ready to start kibitzing on syntax details :-)

Damn, I thought you were going to get rid of the control file there for a sec (in favor of Makefile variables). ;-P

> First off, I don't much care for the name "CREATE WRAPPER EXTENSION".
> WRAPPER is a misnomer in this case --- it's not wrapping anything.
> I think Dimitri stated that he chose WRAPPER just because it was an
> already existing keyword, but that isn't much of an excuse.

What's the WRAPPER bit for? I've forgotten.

> One minor objection to this idea is that "foo--1.0.sql" looks more like a
> typo than anything else. We could alternatively decide that the special
> reserved version name is '0', so that bootstrap script names look like
> "foo-0-1.0.sql". But if you don't want to have any built-in assumptions
> about what version names mean, you might not like that idea.

I'm fine with either of these. "foo-0-1.0.sql" might lead to fewer questions being asked. But I otherwise have no preference.

> Third, I'm also not thrilled with the syntax "ALTER EXTENSION foo
> UPGRADE". UPGRADE isn't an existing keyword (note that VERSION is).
> And I don't see any strong reason to assume that the version change
> is an "upgrade". Authors might well choose to support sidegrades or
> downgrades, especially with experimental modules. I suggest either
>
> ALTER EXTENSION foo UPDATE [ TO 'version' ]
>
> ALTER EXTENSION foo VERSION [ 'version' ]
>
> the main excuse for the latter being that it's closer to the comparable
> syntax in CREATE EXTENSION.
>
> OK, that's enough bikeshedding for today ...

The former reads much more clearly to me.

Best,

David

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-02-11 00:11:04 Re: ALTER EXTENSION UPGRADE, v3
Previous Message Andrew Dunstan 2011-02-10 23:50:00 Re: Debian readline/libedit breakage