Subject: Re: DBD::Pg - UPDATEs, INSERTs fail to work
To: Cillian Sharkey <cns@RedBrick.dcu.ie>
From: Giles Lean <giles@nemeton.com.au>
List: netbsd-help
Date: 09/25/2002 06:28:17
Cillian Sharkey writes:
> The bizarre part is that there are *no* error messages and the operation
> appears to be successful i.e. for an UPDATE it returns that 1 row was
> affected even though the operation never took effect!
What does the PostgreSQL log say? I find when debugging DBI stuff
that looking at the log is most helpful: sometimes I find the SQL
that I've sent is not quite what I wanted to send. :-) On my
development systems I have '-d 2' as an argument when starting
the postmaster. Yes, you need automatic log file rotation with
this. :-)
> Now if I try an UPDATE on a non-existant row it does return a value of
> zero as expected (i.e. no row was updated).
Are you 100% sure that the value returned is the row count?
> Does anyone else have this setup working on 1.6?
Not quite ... PostgresSQL 7.2.2 on some 1.5.1 hosts.
> #!/usr/pkg/bin/perl -w
> ...
Works here, too, and I don't see anything wrong with it. So ... check
the log file.
Giles