Re: Restore 1 Table from pg_dumpall?

Поиск
Список
Период
Сортировка
От Ondrej Ivanič
Тема Re: Restore 1 Table from pg_dumpall?
Дата
Msg-id CAM6mieJ2ge0=wOU+MYaJ7owd9kxgtWZgYTMtVutXX074FCeMAg@mail.gmail.com
обсуждение исходный текст
Ответ на Restore 1 Table from pg_dumpall?  (Rich Shepard <rshepard@appl-ecosys.com>)
Список pgsql-general
Hi,

On 23 January 2013 04:57, Rich Shepard <rshepard@appl-ecosys.com> wrote:
>   Is there a way I can extract a single table's schema and data from the
> full backup? If so, I can then drop the fubar'd table and do it correctly
> this time.

You should grep for:
- CREATE TABLE
- COPY

statements and then note line numbers (fgrep -n). Finally, used `sed`
to get the right part(s) of a file (schema + data):
sed -n 'startline,endlinep' dump.sql > out.sql  (ie. sed -n '10,1000p')

--
Ondrej


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

Предыдущее
От: Rich Shepard
Дата:
Сообщение: Re: seeking SQL book recommendation
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Postfresql 8.4 Problem