pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: George Weaver <georgew1@mts.net>
To: pgsql-sql@postgresql.org
Subject: Re: Capturing pgsql ERRORS/NOTICES to file
Date: Fri, 26 Sep 2003 11:33:57 -0700
Message-ID: <200309261133.57357.josh@agliodbs.com> (raw)
In-Reply-To: <001f01c38458$7865c5b0$560fa18e@cleartag>
References: <001f01c38458$7865c5b0$560fa18e@cleartag>

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



view thread (5+ messages)  latest in thread

Message-ID: <200309261133.57357.josh@agliodbs.com>
Permalink:  ../200309261133.57357.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200309261133.57357.josh@agliodbs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: josh@agliodbs.com, georgew1@mts.net
  Subject: Re: Capturing pgsql ERRORS/NOTICES to file
  In-Reply-To: <200309261133.57357.josh@agliodbs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox