Re: Finer Extension dependencies

From: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
To: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Finer Extension dependencies
Date: 2012-03-23 14:05:37
Message-ID: 87d383pg3y.fsf@hi-media-techno.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr> writes:
> Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
>> Hmm .. feature names should be globally unique, right? If so I think
>> you're missing an UNIQUE index on the new catalog, covering just the
>> feature name. You have a two column index (extoid, featurename), so you
>> could have two different extensions providing the same feature.

Please find v5 of the patch attached, where

=# \d pg_extension_feature
Table "pg_catalog.pg_extension_feature"
Column | Type | Modifiers
------------+------+-----------
extoid | oid | not null
extfeature | name | not null
Indexes:
"pg_extension_feature_name_index" UNIQUE, btree (extfeature)
"pg_extension_feature_oid_index" UNIQUE, btree (oid)
"pg_extension_feature_extoid_name_index" btree (extoid, extfeature)

We could maybe get rid of the (extoid, extfeature) index which is only
used to get sorted output in list_extension_features() function, but I
don't know how to do an ORDER BY scan without index in C (yet).

The ordering is then used to maintain pg_depend when the list of
provided features changes at upgrade time. We fetch the ordered list of
“old” feature names then for each newly provided feature name we
bsearch() the old list, which then needs to be properly ordered.

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

Attachment Content-Type Size
extension-provides.v5.patch text/x-diff 58.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2012-03-23 14:24:43 Re: checkpoint patches
Previous Message Fujii Masao 2012-03-23 14:03:27 Re: Unnecessary WAL archiving after failover