Finer Extension dependencies - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Finer Extension dependencies
Date
Msg-id m2hb0y2bh3.fsf@hi-media.com
Whole thread Raw
Responses Re: Finer Extension dependencies  (Hitoshi Harada <umi.tanuki@gmail.com>)
List 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

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Command Triggers
Next
From: Jim Nasby
Date:
Subject: Re: Autonomous subtransactions