Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 29D902E008C for ; Mon, 17 Dec 2007 21:05:22 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 05963-09 for ; Mon, 17 Dec 2007 21:05:13 -0400 (AST) Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by postgresql.org (Postfix) with ESMTP id D98A82E3283 for ; Mon, 17 Dec 2007 21:05:13 -0400 (AST) Received: from perhan.alvh.no-ip.org (200-126-76-117.bk5-dsl.surnet.cl [200.126.76.117]) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id lBI159V4009849 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 17 Dec 2007 17:05:12 -0800 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 0B77347C88; Mon, 17 Dec 2007 22:05:12 -0300 (CLST) Date: Mon, 17 Dec 2007 22:05:11 -0300 From: Alvaro Herrera To: "A.Burbello" Cc: Postgres Adm List Subject: Re: Dump database more than 1 flat file Message-ID: <20071218010511.GE24103@alvh.no-ip.org> References: <110808.75802.qm@web36204.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <110808.75802.qm@web36204.mail.mud.yahoo.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (lists.commandprompt.com [207.173.203.159]); Mon, 17 Dec 2007 17:05:12 -0800 (PST) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/156 X-Sequence-Number: 27673 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.