X-Original-To: pgsql-interfaces@postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id A59A1924E21 for ; Thu, 29 May 2003 11:44:14 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 87988-06 for ; Thu, 29 May 2003 11:44:13 -0400 (EDT) Received: from semantico.com (choke.semantico.com [212.74.15.98]) by developer.postgresql.org (Postfix) with ESMTP id F09CE924E15 for ; Thu, 29 May 2003 11:44:12 -0400 (EDT) Received: from spampd.localdomain (localhost [127.0.0.1]) by localhost.semantico.com (Postfix) with ESMTP id 38B3432005A; Thu, 29 May 2003 16:44:11 +0100 (BST) Received: from semantico.com (cassia.dyn.rp.lan [192.168.1.236]) by semantico.com (Postfix) with ESMTP id 98A8C32005A; Thu, 29 May 2003 16:44:10 +0100 (BST) Message-ID: <3ED62ACA.90307@semantico.com> Date: Thu, 29 May 2003 16:44:10 +0100 From: Dominic Mitchell Organization: Semantico User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2) Gecko/20021126 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Wheeler Cc: Rudy Lippan , Bruce Momjian , pgsql-interfaces@postgresql.org, 'DBI developers' Subject: Re: DBD::Pg 1.30_1 WAS (Re: Prepare and prepare ?) References: <505BBD9E-91EB-11D7-975B-0003931A964A@wheeler.net> In-Reply-To: <505BBD9E-91EB-11D7-975B-0003931A964A@wheeler.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=-102.5 required=5.0 tests=CARRIAGE_RETURNS,IN_REP_TO,NOSPAM_INC,QUOTED_EMAIL_TEXT, REFERENCES,SPAM_PHRASE_00_01,USER_AGENT, USER_AGENT_MOZILLA_UA,USER_IN_WHITELIST,X_ACCEPT_LANG version=2.44 X-Spam-Level: X-Virus-Scanned: by amavisd-new X-Archive-Number: 200306/12 X-Sequence-Number: 4223 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: > > > > open STDERR, "| perl -ne 'print unless /: NOTICE: /'" > or die "Cannot pipe STDERR: $!\n"; > > 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