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.