Skip site navigation (1) Skip section navigation (2)

DBD::PG question

From: Frank Bax <fbax(at)sympatico(dot)ca>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: DBD::PG question
Date: 2005-03-29 12:30:48
Message-ID: 5.2.1.1.0.20050329072552.0581e2b0@pop6.sympatico.ca (view raw or flat)
Thread:
Lists: pgsql-interfaces
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?

Frank


Responses

pgsql-interfaces by date

Next:From: Frank BaxDate: 2005-03-29 17:54:22
Subject: Re: DBD::PG question
Previous:From: John DeSoiDate: 2005-03-29 01:13:59
Subject: Re: MS Access/ODBC 'ERROR: invalid input syntax fo

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group