Re: [GENERAL] Shell script to extract a table from a plain text dump
В списке pgsql-hackers по дате отправления:
| От | Christopher Kings-Lynne |
|---|---|
| Тема | Re: [GENERAL] Shell script to extract a table from a plain text dump |
| Дата | |
| Msg-id | 43477AD4.9000905@familyhealth.com.au обсуждение |
| Ответ на | Re: [GENERAL] Shell script to extract a table from a plain text dump (Martijn van Oosterhout <kleptog@svana.org>) |
| Список | pgsql-hackers |
Argh! That's some sed coolness :) Chris Martijn van Oosterhout wrote: > On Fri, Oct 07, 2005 at 04:46:12PM +0800, Christopher Kings-Lynne wrote: > >>If you have huge plain text dumps, and just want to restore one table >>it's usually painful. Attached is a small shell script that can take a >>plain text dump and extract a single table's COPY data commands from it. >> >>If people think it's interesting and should be developed, I can pop it >>on pgfoundry or something. > > > Hmm, what I usually use is: > > bzcat $file | sed -ne "/^COPY \"$table\" /,/^\\\.\$/p" > > However, error checking and wrapping it into a script is a good idea. > If it got given a couple of switches to control the output, maybe we > can have a pg_restore for text dumps :) > > Have a nice day,
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера