Re: pg_dump vs schemas - Mailing list pgsql-general

From Jeff Davis
Subject Re: pg_dump vs schemas
Date
Msg-id 1184612769.16532.15.camel@dogma.ljc.laika.com
Whole thread Raw
In response to Re: pg_dump vs schemas  (Francisco Reyes <lists@stringsutils.com>)
List pgsql-general
On Mon, 2007-07-16 at 14:58 -0400, Francisco Reyes wrote:
> One possible way may be:
> Dump the source schema.
> Remove references to the schema name in the pg_dump file.
> Change search_path and restore schema.

That's what I currently do. It seems a little flimsy though: there are
too many objects to really remove the references by hand, so we do a
global search-and-replace. As long as the schema name is unique enough,
I suppose it's alright for a development (non-production) database.

> > How do other people do that? Is it worth trying to add a way for
> > pg_restore to rename object?
>
> In the particular case that you mentioned, if pg_dump could be made to not
> include the schema name anywhere that should make the process easier.

That's what I was thinking. It might be better placed in pg_restore
though, so that way you can decide after you've already made the backup.

Regards,
    Jeff Davis


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Moved postgres, now won't start
Next
From: Steve Atkins
Date:
Subject: Re: What's the logical counterpart of the to_hex function?