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 87aaiohssa.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  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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


pgsql-hackers by date:

Previous
From: Itagaki Takahiro
Date:
Subject: Re: REVIEW: WIP: plpgsql - foreach in
Next
From: Simon Riggs
Date:
Subject: Re: log_checkpoints and restartpoint