Re: Problem with Postgres V 8 and DBI maybe - Mailing list pgsql-general

From Michael Fuhr
Subject Re: Problem with Postgres V 8 and DBI maybe
Date
Msg-id 20050125232108.GB96518@winnie.fuhr.org
Whole thread Raw
In response to Problem with Postgres V 8 and DBI maybe  (David Siebert <david@eclipsecat.com>)
List pgsql-general
On Tue, Jan 25, 2005 at 05:49:11PM -0500, David Siebert wrote:

> I am trying to add records to a table in DBI and I keep getting an error  7
> The exact error is DBD::Pg::st execute failed:  at connect.pl line 107.
> ERROR!!! (7) INSERT INTO phonegroups VALUES ('TECHIES',1, 1)

Hmmm...I don't think DBI or DBD::Pg prints errors like "ERROR!!! (7)".
Are you doing your own error checking and only looking at $DBI::err?
What does $DBI::errstr say?

Have you tried to reduce the problem to the smallest amount of code
necessary to reproduce the problem?  Something like this:

my $dbh = DBI->connect($source, $user, $password, {RaiseError => 1});
my $sth = $dbh->prepare("INSERT INTO phonegroups VALUES (?, ?, ?)");
$sth->execute("TECHIES", 1, 1);
$dbh->disconnect;

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

pgsql-general by date:

Previous
From: David Garamond
Date:
Subject: Re: EMBEDDED PostgreSQL
Next
From: "Jim C. Nasby"
Date:
Subject: Re: How are foreign key constraints built?