Re: Extensions, patch v16 - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: Extensions, patch v16
Date
Msg-id m2pqt94ecu.fsf@2ndQuadrant.fr
Whole thread Raw
In response to Re: Extensions, patch v16  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Extensions, patch v16
Re: Extensions, patch v16
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:
> This doesn't answer my question of why it couldn't be done the other
> way.  Why does the makefile need to know it?  If it does need to know
> it, couldn't it get it out of the control file instead of vice versa?

Well the Makefile support is just a facility to fill in the control file
automatically for you, on the grounds that you're probably already
maintaining your version number in the Makefile. Or that it's easy to
get it there, as in:

EXTVERSION = $(shell dpkg-parsechangelog | awk -F '[:-]' '/^Version:/ { print substr($$2, 2) }')

That comes from a real world example that's yet to be adapted to being
an extension in 9.1, but still:
 https://github.com/dimitri/pgfincore/blob/debian/Makefile

> I'm not convinced that this is actually a requirement, or that doing it
> this specific way is a good solution.  In particular, keeping the
> version number in the system catalogs seems pretty dubious.  The common
> method for upgrading an already-installed contrib module just involves
> dropping in a new .so --- that's not going to change the system
> catalogs.  It would likely be better to keep the version ID inside the
> .so file.

Upgrade are left for a future patch, did we decide. Still, it seems to
me that we will support some upgrade scripts so that author can decide
what to do knowing current and next version, and yes, knowing that the
module has already been taken care of by the OS-level packaging.

That means some extensions upgrades will break the database between the
OS-level package upgrade and the sql upgrade (support to come), but in
my experience that's seldom the case. And not by chance.

So in the case that only the module (.so) needs upgrading, we would
still provide for an upgrade path in the script / sql support so that
the version number has a chance of being upgraded too.  As you say in
another mail, of course, the OS packaging system will not forcibly be
willing to care for that all by itself. I can imagine debian offering
the choice to the users and acting accordingly, though.

Regards,
-- 
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support


pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: Extensions, patch v16
Next
From: "BRUSSER Michael"
Date:
Subject: Re: initdb failure with Postgres 8.4.4