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: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers

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

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:

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:

Dimitri Fontaine     PostgreSQL : Expertise, Formation et Support

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


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-2018 The PostgreSQL Global Development Group