Re: How to get some table entries from backup instance back to production instance

From: Martin Steer <martinsteer(at)maxi(dot)net(dot)au>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: How to get some table entries from backup instance back to production instance
Date: 2015-02-10 12:36:01
Message-ID: 20150210123601.GD18165@arch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Tue, Feb 10, 2015 at 09:39:25AM +0100, Marcel Ruff wrote:
>
>I have 4 tables with 1:n relation:
>
> grandpa -> pa -> child -> grandchild
>
>Now I need to copy an instance of "pa" with his descendants
>from my backup (a postgres dump) back to prod.
>"grandchild" has a blob column (containing fotos)
>
>Which options do I have?
>
>1) Import the backup dump in a separate postgres instance
>2) Do some magic query which created insert statements
>3) Run the insert statements on the prod server
>
>What is the best approach, and how does a query look like which
>returns nicely formatted insert lines?

You want to copy some tables from one db (or dump) to another?

Perhaps you should look at the man pages for pg_dump and pg_restore.
pg_restore allows the loading of a single table, or group of tables,
into a specified database.

M.

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message petrov.boris.v@mail.ru 2015-02-10 13:04:55 Who should own database?
Previous Message daku.sandor 2015-02-10 09:04:00 Re: How to get some table entries from backup instance back to production instance