Re: Capturing pgsql ERRORS/NOTICES to file - Mailing list pgsql-sql

From Josh Berkus
Subject Re: Capturing pgsql ERRORS/NOTICES to file
Date
Msg-id 200309261133.57357.josh@agliodbs.com
Whole thread Raw
In response to Capturing pgsql ERRORS/NOTICES to file  ("George Weaver" <georgew1@mts.net>)
List pgsql-sql
George,

> I am in the process of creating a batch file that will update some
> functions in a database for a remote user similar to:
>
> psql -o output dbname < functionupdate.sql
>
> Is there any way to save any ERROR and NOTICE messages to a file?
>
> The -o option doesn't capture this information.

You have to use command shell redirects.

For example, I commonly do in bash
psql -o output dbname < functionupdate.sql >out.dump
... which sends all the command responses to a file, allowing me to read only 
the errors on the screen.

See a guide to your shell for more creative redirection.

-- 
Josh Berkus
Aglio Database Solutions
San Francisco


pgsql-sql by date:

Previous
From: "George Weaver"
Date:
Subject: Capturing pgsql ERRORS/NOTICES to file
Next
From: Wei Weng
Date:
Subject: Re: tsearch2 question