Search Postgresql Archives

Re: Restoring selected records from backup file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday, March 02, 2012 2:20:14 am Piyush Lenka wrote:
> hi,
> 
> 1. How can we restore selected records from a plain text backup
> (backup.sql).

The only way I know is to use some text processing tool to walk through and pull 
out the records.

> 2. Is it possible using psql. If yes how

I assume you mean the psql client program. There is no way to get it to read a 
backup file and pull data, as far as I know.

You can use the \copy command to pull out selected records from a table and dump 
them to a disk file. See here for more info:
http://www.postgresql.org/docs/9.0/interactive/app-psql.html

You could also do a CREATE TABLE AS to  create a table with the records you are 
interested and then do pg_dump -t to get that information.

http://www.postgresql.org/docs/9.0/interactive/sql-createtableas.html


> Please Help
> 
> Thanks & Regards
> Piyush

-- 
Adrian Klaver
adrian.klaver@xxxxxxxxx

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux