Skip site navigation (1) Skip section navigation (2)

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

  CREATE VIEW pg_available_extensions AS
      SELECT n.nspname as "schema",, X.extversion as "installed",
             E.version, E.relocatable, E.comment
        FROM pg_available_extensions() AS E
             LEFT JOIN pg_extension as X ON = 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.

Dimitri Fontaine     PostgreSQL : Expertise, Formation et Support

In response to


pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group