Re: Problem with Postgres V 8 and DBI maybe

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: David Siebert <david(at)eclipsecat(dot)com>
Cc: pgsql general list <pgsql-general(at)postgresql(dot)org>
Subject: Re: Problem with Postgres V 8 and DBI maybe
Date: 2005-01-25 23:21:08
Message-ID: 20050125232108.GB96518@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jim C. Nasby 2005-01-25 23:35:02 Re: How are foreign key constraints built?
Previous Message David Garamond 2005-01-25 23:15:42 Re: EMBEDDED PostgreSQL