Re: Extensions support for pg_dump, patch v27

From: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
To: Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>
Cc: Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>, PostgreSQL-Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Extensions support for pg_dump, patch v27
Date: 2011-01-31 10:21:09
Message-ID: 87bp2xbch6.fsf@hi-media-techno.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com> writes:
> * "relocatable" and "schema" seems to be duplicated options.

They are not, really. If you have a relocatable extension, then there's
no schema option in the control file (setting it is an ERROR). If you
have a non-relocatable extension, then you can either setup the schema
to force it as the extension's author (or distributor / packager), or
leave it alone and use the @extschema@ facility instead.

> * "version" field in pg_available_extension might mislead when
> a newer version of an extension is available but an older version
> is installed. How about returning installed version for "installed"
> field instead of booleans? The field will be NULLs if not installed.

Good idea, I've done that in the pg_available_extension system view.

> * I want to remove O(n^2) behavior in pg_extensions(). It scans
> pg_extension catalog to return whether the extension is installed,
> but it would be better to change the function to return just whole
> extensions and JOIN with pg_extension in pg_available_extensions.
> (it's the same technique used in pg_stat_replication)

Well, that allows to get rid of the whole extension's listing internal
function. Less code is good :) Here's the new system's view:

http://pgsql.tapoueh.org/extensions/doc/html/view-pg-available-extensions.html

CREATE VIEW pg_available_extensions AS
SELECT n.nspname as "schema", E.name, X.extversion as "installed",
E.version, E.relocatable, E.comment
FROM pg_available_extensions() AS E
LEFT JOIN pg_extension as X ON E.name = X.extname
LEFT JOIN pg_namespace as N on N.oid = X.extnamespace;

The new code (and documentation) is published in the git repository, I'm
waiting a little bit more before (for your comments) to prepare the
patch v30, or just tell me and I'll do that.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Naoya Anzai 2011-01-31 11:42:31 BUG #5856: pg_attribute.attinhcount is not correct.
Previous Message Pavel Stehule 2011-01-31 09:34:50 Re: [pgsql-general 2011-1-21:] Are there any projects interested in object functionality? (+ rule bases)