Re: Restoring selected records from backup file

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Restoring selected records from backup file
Дата
Msg-id 201203021521.13487.adrian.klaver@gmail.com
обсуждение исходный текст
Ответ на Restoring selected records from backup file  (Piyush Lenka <lenka.piyush@gmail.com>)
Список pgsql-general
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@gmail.com

В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: role missing in dump
Следующее
От: Thomas Prause
Дата:
Сообщение: Re: role missing in dump