pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: davidh <david@beechglen.com>
To: Piyush Lenka <lenka.piyush@gmail.com>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: Restoring selected records from backup file
Date: Sat, 3 Mar 2012 09:17:02 -0500
Message-ID: <5E065B94-763E-4CEF-B235-6E6632CDF35C@beechglen.com> (raw)
In-Reply-To: <CAFOD=KDQuTAroe4tt6==o-cqpFLUmM9BJfar315f21iLt9SNFg@mail.gmail.com>
References: <CAFOD=KDQuTAroe4tt6==o-cqpFLUmM9BJfar315f21iLt9SNFg@mail.gmail.com>

The only way I know of doing this is to restore the backup to a separate database or table and doing a "SELECT INTO" statement. The only caveat is that you need to make sure you delete the outdated records from the prod table. To do this you may have to temporarily disable foreign key enforcing. 

David. 

On Mar 2, 2012, at 5:19 AM, Piyush Lenka <lenka.piyush@gmail.com> wrote:

> hi,
> 
> 1. How can we restore selected records from a plain text backup (backup.sql).
> 2. Is it possible using psql. If yes how
> Please Help
> 
> Thanks & Regards 
> Piyush



view thread (2+ messages)

Message-ID: <5E065B94-763E-4CEF-B235-6E6632CDF35C@beechglen.com>
Permalink:  ../5E065B94-763E-4CEF-B235-6E6632CDF35C@beechglen.com/
Also on:    postgresql.org/message-id/5E065B94-763E-4CEF-B235-6E6632CDF35C@beechglen.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: david@beechglen.com, lenka.piyush@gmail.com
  Subject: Re: Restoring selected records from backup file
  In-Reply-To: <5E065B94-763E-4CEF-B235-6E6632CDF35C@beechglen.com>
  References: <CAFOD=KDQuTAroe4tt6==o-cqpFLUmM9BJfar315f21iLt9SNFg@mail.gmail.com> <5E065B94-763E-4CEF-B235-6E6632CDF35C@beechglen.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox