Hi Manoj,
As Martin Pitt (libpq[34] maintainer) notes, connections to any server
version back to 7.3 should work. This is a bug in libdbd-pg-perl.
The error message you receive is:
syntax error at or near "$1" at character 80
I suspect this has something to do with the libdbd-pg-perl upstream
switch to server-side prepared statements (i.e. ->prepare and ->execute
actually store the parsed statement server-side, rather than resending
each time), and that it is triggered by specific SQL and column types. I
am using libdbd-pg-perl 1.43 against a 7.4 server with no problems.
Could you patch your "Code that uses the DB" with the following patch
and report the error you receive? This will report the bad SQL
statement being executed in addition the error message.
Also please report the schema of any tables referenced by the SQL
causing the error (Output of "\d tablename" in psql).
Thanks!
--- db_code.old 2005-10-03 05:28:57.000000000 -0700
+++ db_code 2005-10-03 05:34:17.000000000 -0700
@@ -19,7 +19,7 @@
$greylist_password,
{
PrintError => 0,
- RaiseError => 1,
+ RaiseError => 0,
AutoCommit => 0
})
or die $DBI::errstr;
@@ -119,7 +119,8 @@
for my $sql (keys %SQL_Commands) {
$Handles{$sql} = $dbh->prepare($SQL_Commands{ $sql});
}
- $Handles{Select}->execute($ip, $sender, $recipient);
+ $Handles{Select}->execute($ip, $sender, $recipient)
+ or die $Handles{Select}->errstr. ' executing '.
$SQL_Commands{Select};
my ($rid,$create_time,$last_update,$record_expires,$block_expires,
$passed_count);
@@ -132,7 +133,8 @@
$Handles{Select}->finish;
$Handles{Insert}->execute($ip, $sender, $recipient, $now,
"$greylist_black seconds", $now,
- "$greylist_grey seconds", $now, $now);
+ "$greylist_grey seconds", $now, $now)
+ or die $Handles{Insert}->errstr. ' executing '.
$SQL_Commands{Insert};
$dbh->commit();
$result = $greylist_black;
$event = 'new';
@@ -144,7 +146,8 @@
$result = UnixDate($block_expires,"%s")-UnixDate($now,"%s");
$event = 'black';
#Log a note that they retried under our window
- $Handles{Blocked}->execute($now, $rid);
+ $Handles{Blocked}->execute($now, $rid)
+ or die $Handles{Blocked}->errstr. ' executing '.
$SQL_Commands{Blocked};
$dbh->commit();
$Handles{Blocked}->finish;
}
@@ -156,14 +159,16 @@
# Log a note that they retried sucessfully, and make sure they
are
# updated to the whitelist window
- $Handles{Success}->execute($now,"$greylist_white seconds",
$now, $rid);
+ $Handles{Success}->execute($now,"$greylist_white seconds",
$now, $rid)
+ or die $Handles{Success}->errstr. ' executing '.
$SQL_Commands{Success};
$dbh->commit();
$Handles{Success}->finish;
}
else { #$now > $record_expires
# At this point they are retrying past their expiration
$Handles{Old}->execute($now, "$greylist_black seconds", $now,
- "$greylist_grey seconds", $now, $rid);
+ "$greylist_grey seconds", $now, $rid)
+ or die $Handles{Old}->errstr. ' executing '.
$SQL_Commands{Old};
$dbh->commit();
$Handles{Old}->finish;
$result = $greylist_black;
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]