X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1BEA214B27FC for ; Thu, 12 Aug 2004 12:01:00 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 34191-06 for ; Thu, 12 Aug 2004 15:00:52 +0000 (GMT) Received: from anchor-post-33.mail.demon.net (anchor-post-33.mail.demon.net [194.217.242.91]) by svr1.postgresql.org (Postfix) with ESMTP id 8A9DF14B2821 for ; Thu, 12 Aug 2004 12:00:51 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-33.mail.demon.net with esmtp (Exim 3.35 #1) id 1BvH4P-000M6Q-0X; Thu, 12 Aug 2004 15:00:47 +0000 Received: from [192.168.1.17] (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id C5A6116A2C; Thu, 12 Aug 2004 16:00:28 +0100 (BST) Message-ID: <411B860F.4020305@archonet.com> Date: Thu, 12 Aug 2004 16:00:31 +0100 From: Richard Huxton User-Agent: Mozilla Thunderbird 0.7 (X11/20040615) X-Accept-Language: en-us, en MIME-Version: 1.0 To: devin@synapticvision.com Cc: pgsql-sql@postgresql.org Subject: Re: Sending errors from psql to error file References: <1092320416.23985.24.camel@192.168.1.80> In-Reply-To: <1092320416.23985.24.camel@192.168.1.80> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/112 X-Sequence-Number: 18609 Devin Whalen wrote: > I don't want to have to sit there and watch the import go by, I want to > run a command and then look in a file for any errors after the import is > complete. I tried this command but it didn't work: > gunzip -c cli_postDataInserts.sql.gz | psql cli_post -U system | grep > "ERROR:*" > import_errors Try something like: ... psql cli_post 2>import_errors STDOUT is file-handle 1, STDERR is file-handle 2. You might also want to read up on the "tee" utility. -- Richard Huxton Archonet Ltd