Re: Extensions support for pg_dump, patch v27

From: Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>
To: Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "David E(dot) Wheeler" <david(at)kineticode(dot)com>, David Fetter <david(at)fetter(dot)org>, PostgreSQL-Hackers <pgsql-hackers(at)postgresql(dot)org>, Dave Page <dpage(at)postgresql(dot)org>, Guillaume Lelarge <guillaume(at)lelarge(dot)info>
Subject: Re: Extensions support for pg_dump, patch v27
Date: 2011-01-27 12:02:15
Message-ID: AANLkTi=AysNSqcUF6pC4Ft5vMdEKiV+MWHJ_9PCD-8xi@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jan 27, 2011 at 20:01, Dimitri Fontaine <dimitri(at)2ndquadrant(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-01-27 12:27:50 Re: [HACKERS] Seeking Mentors for Funded Reviewers
Previous Message Dimitri Fontaine 2011-01-27 11:01:46 Re: Extensions support for pg_dump, patch v27