Skip site navigation (1) Skip section navigation (2)

Finer Extension dependencies

From: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Finer Extension dependencies
Date: 2011-12-18 14:36:24
Message-ID: m2hb0y2bh3.fsf@hi-media.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Hi,

The extensions work we began in 9.1 is not yet finished entirely
(*cough*), so I'm opening a new patch series here by attacking the
dependency problems.

Some people want us to manage extension version numbers with sorting
semantics so that we are able to depend on foo >= 1.2 and crazy things
like this, and I think the need is reasonable and easier than that to
address.

I'm proposing a patch that implements a very simple concept, yet
powerful enough to express very complex dependencies:

 - extensions are allowed to provide a list of named features
 - extensions now require one or more feature names

With that tool in hands, you can reliably depend on some feature you
need rather than having to check a feature matrix to see for yourself
which version number implements it then paste that number into your
dependency rules.

It's also easier to deprecate a feature, just remove its name from the
provide list in your extension's control file (remember you can have one
of those per version, with overriding parameters).  alter extension
update will then fire the dependency resolution mechanism and bail out
when another extension requires a feature you want to remove.

The default behavior for an extension having its control file "provides"
parameter not set is to provide only one feature named the same as the
extension itself.  In fact whatever happens, the extension always
provides at least that feature.  Which means that by default, it all
works the same as it does in 9.1.

So please find attached the said patch, which you can also prefer to
browse online:

  https://github.com/dimitri/postgres/compare/master...extfeats

I think it would be good to commit a follow-up patch exposing the
PostgreSQL core feature matrix with the proposed support here, so that
extension can require core features easily too. Maybe those documents
would be a start:

  http://www.postgresql.org/docs/9.1/static/features-sql-standard.html
  http://www.postgresql.org/about/featurematrix/

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


Attachment: extension-provides.v1.patch
Description: text/x-patch (58.6 KB)

Responses

pgsql-hackers by date

Next:From: Jim NasbyDate: 2011-12-18 16:22:11
Subject: Re: Autonomous subtransactions
Previous:From: Bruce MomjianDate: 2011-12-18 14:21:31
Subject: Re: Command Triggers

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group