Re: Sending errors from psql to error file

From: Richard Huxton <dev(at)archonet(dot)com>
To: devin(at)synapticvision(dot)com
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Sending errors from psql to error file
Date: 2004-08-12 15:00:31
Message-ID: 411B860F.4020305@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Devin Whalen 2004-08-12 15:01:21 Re: Sending errors from psql to error file
Previous Message Oliver Elphick 2004-08-12 14:50:34 Re: Sending errors from psql to error file