Re: Silencing NOTICEs in Perl Pg - Mailing list pgsql-admin

From Bruno Wolff III
Subject Re: Silencing NOTICEs in Perl Pg
Date
Msg-id 20020829200201.GA27531@wolff.to
Whole thread Raw
In response to Re: Silencing NOTICEs in Perl Pg  (David Wheeler <david@wheeler.net>)
Responses Re: Silencing NOTICEs in Perl Pg
List pgsql-admin
On Thu, Aug 29, 2002 at 12:17:16 -0700,
  David Wheeler <david@wheeler.net> wrote:
> BTW, I missed the beginning of this thread, but based on the subject,
> I'd sure like to find out if there's a simple way to suppress NOTICEs
> using DBI/DBD::Pg. I've tried a number of tricks, but short of closing
> STDOUT and STDERR in my Perl script, I've not found a way to do it.
> PrintError => 0 doesn't do the trick.

I do the following before doing anything with the database:
open(OLDERR, '>&STDERR');
close(STDERR);
open(STDERR, '>/dev/null');

I then print my error messages to OLDERR instead of STDERR.

pgsql-admin by date:

Previous
From: David Wheeler
Date:
Subject: Re: Silencing NOTICEs in Perl Pg
Next
From: "Vilson farias"
Date:
Subject: Some timestamp problems