Re: Extensions support for pg_dump, patch v27
Dimitri Fontaine <dimitri@2ndquadrant.fr>
From: Dimitri Fontaine <dimitri@2ndQuadrant.fr>
To: Itagaki Takahiro <itagaki.takahiro@gmail.com>
Cc: "David E. Wheeler" <david@kineticode.com>,
David Fetter <david@fetter.org>, Dimitri Fontaine <dimitri@2ndquadrant.fr>, PostgreSQL-Hackers <pgsql-hackers@postgresql.org>
Date: 2011-01-26T10:18:45Z
Lists: pgsql-hackers
Itagaki Takahiro <itagaki.takahiro@gmail.com> writes: > Since pg_dump won't dump user objects in pg_catalog, adminpack can > avoid the above errors by installing functions in pg_catalog. > CREATE EXTENSION might have the same issue -- Can EXTENSION work > without errors when we install extensions in template databases? Well in fact the reason why pg_dump will not dump the extension when it's installed in pg_catalog is that the pg_depend entry is not recorded, and the SQL query pg_dump uses gets its data from pg_extension JOIN pg_depend JOIN pg_namespace. The missing entry in pg_depend is the reason why the extension is not part of the dump. We could fix that using a LEFT JOIN here and COALESCE to force the namespace as pg_catalog. Is that not a kludge? If acceptable, I will do that next. Regards, -- Dimitri Fontaine http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support