Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) - Mailing list pgsql-interfaces

From Dominic Mitchell
Subject Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)
Date
Msg-id 3ED62ACA.90307@semantico.com
Whole thread Raw
In response to Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?)  (David Wheeler <david@wheeler.net>)
List pgsql-interfaces
David Wheeler wrote:
> On Thursday, May 29, 2003, at 02:00  AM, Dominic Mitchell wrote:
> 
>> One more thing for the change log:  notice messages generated by the 
>> database now use the perl warning mechanism instead of going to 
>> stderr, so they can be trapped if needed.
> 
> 
> Oh, sweet! How did you do that? I've been doing this to catch them:
> 
> <hack caveat="ugly">
> 
>   open STDERR, "| perl -ne 'print unless /: NOTICE:  /'"
>     or die "Cannot pipe STDERR: $!\n";
> 
> </hack>

Just hook up the existing libpq function PQsetNoticeProcessor() to a 
XS's warn in dbdimp.c.  It's about 5 lines of code.  I don't know 
whether it's 100% correct (I'm no XS guru), but it Works For Me[tm].

-Dom



pgsql-interfaces by date:

Previous
From: Jan Emonson & Rick Gregory
Date:
Subject: Re: Got Problems with libpg.dll
Next
From: Kaare Rasmussen
Date:
Subject: LISTEN and NOTIFY