Re: unable to restore. pg_restore: implied data-only restore

From: Tim Uckun <timuckun(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: unable to restore. pg_restore: implied data-only restore
Date: 2011-05-25 02:05:13
Message-ID: BANLkTinE=xcerW+dpUB0fVPS37E1d698mw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
> There is no support for that built into pg_dump.  You could try:

That's too bad.

>
> * dumping to a text script and doing search-and-replace for the schema
> name on the script file.

I did a dump without privileges or owners so I was thinking I could
just replace the

SET search_path = public, pg_catalog;

At the top and it might work. However I do see a lot of comments with
the schema name in them like.

--
-- TOC entry 18 (class 1255 OID 16417)
-- Dependencies: 6
-- Name: get_text_document(character varying); Type: FUNCTION; Schema:
public; Owner: -
--

Does pg_restore use these comments in some way? Should I change those as well?

> * temporarily renaming the target database's public schema out of the
> way, then renaming after the restore.
>
> * doing the schema rename on the source database before you dump.

This might be the easiest way now that I think about it.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Greg Smith 2011-05-25 02:06:40 Re: Postgresql CBT
Previous Message Tom Lane 2011-05-25 01:59:23 Re: unable to restore. pg_restore: implied data-only restore