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

From Itagaki Takahiro
Subject Re: Extensions support for pg_dump, patch v27
Date
Msg-id AANLkTi=AysNSqcUF6pC4Ft5vMdEKiV+MWHJ_9PCD-8xi@mail.gmail.com
Whole thread Raw
In response to Re: Extensions support for pg_dump, patch v27  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
Responses Re: Extensions support for pg_dump, patch v27  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
List pgsql-hackers
On Thu, Jan 27, 2011 at 20:01, Dimitri Fontaine <dimitri@2ndquadrant.fr> wrote:
> Ok, done.  Of course, it solves the whole problem Itagaki had with
> adminpack because we stop relying on dependencies to get it right now.

I found pg_restore with -c option fails when an extension is created
in pg_catalog. Since pg_catalog is an implicit search target, so we
might need the catalog to search_path explicitly.
Note that I can restore adminpack with not errors because it has
explicit "pg_catalog." prefix in the installer script.

----
postgres=# CREATE EXTENSION cube WITH SCHEMA pg_catalog;
$ pg_dump -Fc postgres > postgres.dump
$ pg_restore -d postgres -c postgres.dump
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 1; 3996 16678 EXTENSION cube
pg_restore: [archiver (db)] could not execute query: ERROR:  no schema
has been selected to create in
----

BTW, I have a minor comments for the code. extern bool extension_relocatable_p(Oid ext_oid);
What is "_p" ?  Also, we could make the function static
because it is used only in extension.c.

--
Itagaki Takahiro


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: COPYRIGHT vs psql \copyright
Next
From: Hiroshi Inoue
Date:
Subject: setlocale and gettext in Postgres