Re: Dump database more than 1 flat file

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Dump database more than 1 flat file
Дата
Msg-id 20071218010511.GE24103@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: Dump database more than 1 flat file  ("A.Burbello" <burbello3000@yahoo.com.br>)
Ответы Re: Dump database more than 1 flat file  (Thomas Pundt <mlists@rp-online.de>)
Список pgsql-admin
A.Burbello wrote:

> If doesn't have another way, how can I put the
> "header" in the begin of file without open?
> With "cat >>" command I put in the end.

Don't -- you can put the header in a separate file and do something like

(cat header-file ; cat split-1 ; cat tail-file ) | psql

lather, rinse, repeat.  (Each split-N file would be an output file from
split).  I'm not sure if you also need the tail-file containing the \.
The parens tell the shell to execute all those commands and send the
output of all of them into the single psql process.

Of course you can automate it further, once you've copied all the DVDs
into a directory in the destination server:

for file in split-*; do
  ( cat header-file ; cat $file ; cat tail-file ) | psql
done

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

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

Предыдущее
От: "Phillip Smith"
Дата:
Сообщение: Re: Dump database more than 1 flat file
Следующее
От: "Tena Sakai"
Дата:
Сообщение: Re: How would I "close" a atble?