Re: Capturing pgsql ERRORS/NOTICES to file

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: "George Weaver" <georgew1(at)mts(dot)net>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Capturing pgsql ERRORS/NOTICES to file
Date: 2003-09-26 18:33:57
Message-ID: 200309261133.57357.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Wei Weng 2003-09-26 18:34:11 Re: tsearch2 question
Previous Message George Weaver 2003-09-26 18:00:00 Capturing pgsql ERRORS/NOTICES to file