X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B12F7537B6 for ; Tue, 29 Mar 2005 18:55:08 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 32478-05 for ; Tue, 29 Mar 2005 17:55:06 +0000 (GMT) Received: from tomts16-srv.bellnexxia.net (tomts16-srv.bellnexxia.net [209.226.175.4]) by svr1.postgresql.org (Postfix) with ESMTP id 908E8535B3 for ; Tue, 29 Mar 2005 18:55:04 +0100 (BST) Received: from acer.sympatico.ca ([65.95.174.14]) by tomts16-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20050329175501.HHCG27508.tomts16-srv.bellnexxia.net@acer.sympatico.ca> for ; Tue, 29 Mar 2005 12:55:01 -0500 Message-Id: <5.2.1.1.0.20050329124852.00ac9130@pop6.sympatico.ca> X-Sender: b1wudu74@pop6.sympatico.ca X-Mailer: QUALCOMM Windows Eudora Version 5.2.1 Date: Tue, 29 Mar 2005 12:54:22 -0500 To: pgsql-interfaces@postgresql.org From: Frank Bax Subject: Re: DBD::PG question In-Reply-To: <5.2.1.1.0.20050329072552.0581e2b0@pop6.sympatico.ca> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.11 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200503/82 X-Sequence-Number: 5411 At 07:30 AM 3/29/05, Frank Bax wrote: >In a perl script using DBI and DBD:Pg, I need to drop/create a table: > $dbp->{RaiseError} = 0; > $dbp->do( "DROP TABLE $table" ); > $dbp->{RaiseError} = 1; > $dbp->do( "CREATE TABLE $table ..." ); > >If the table does not exist, the "DROP TABLE" produces an error message; >but script doesn't die because RaiseError was set to zero. Is there a way >to suppress this error message and then reset the change so an error in >create *is* seen? Thanks to Sean for suggesting I turn PrintError off/on: http://search.cpan.org/~timb/DBI-1.48/DBI.pm#PrintError Works as advertised - if only I'd found those docs before asking my question...