Re: Extensions support for pg_dump, patch v27 - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: Extensions support for pg_dump, patch v27
Date
Msg-id 87bp2xbch6.fsf@hi-media-techno.com
Whole thread Raw
In response to Re: Extensions support for pg_dump, patch v27  (Itagaki Takahiro <itagaki.takahiro@gmail.com>)
Responses Re: Extensions support for pg_dump, patch v27  (Itagaki Takahiro <itagaki.takahiro@gmail.com>)
List pgsql-hackers
Itagaki Takahiro <itagaki.takahiro@gmail.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
ONE.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


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: [pgsql-general 2011-1-21:] Are there any projects interested in object functionality? (+ rule bases)
Next
From: Dan Ports
Date:
Subject: Re: SSI patch version 14