I'm not sure this is the correct fix or not, but with this patch, make
test works well on my postgresql-7.4.7.
Index: dbdimp.c
===================================================================
RCS file: /usr/local/cvsroot/dbdpg/dbdpg/dbdimp.c,v
retrieving revision 1.98
diff -u -r1.98 dbdimp.c
--- dbdimp.c 29 Jan 2005 18:53:52 -0000 1.98
+++ dbdimp.c 6 Mar 2005 12:20:12 -0000
@@ -1251,7 +1251,11 @@
params = imp_sth->numphs;
paramTypes = calloc(imp_sth->numphs, sizeof(*paramTypes));
for (x=0,currph=imp_sth->ph; NULL != currph; currph=currph->nextph) {
- paramTypes[x++] = currph->bind_type->type_id;
+ if (BYTEAOID==currph->bind_type->type_id) {
+ paramTypes[x++] = currph->bind_type->type_id;
+ } else {
+ paramTypes[x++] = 0;
+ }
}
}
result = PQprepare(imp_dbh->conn, imp_sth->prepare_name, statement,
params, paramTypes);
@@ -1662,7 +1666,11 @@
/* Populate paramTypes */
paramTypes = calloc(imp_sth->numphs, sizeof(*paramTypes));
for (x=0,currph=imp_sth->ph; NULL != currph; currph=currph->nextph) {
- paramTypes[x++] = currph->bind_type->type_id;
+ if (BYTEAOID==currph->bind_type->type_id) {
+ paramTypes[x++] = currph->bind_type->type_id;
+ } else {
+ paramTypes[x++] = 0;
+ }
}
if (dbis->debug >= 10) {
Index: t/12placeholders.t
===================================================================
RCS file: /usr/local/cvsroot/dbdpg/dbdpg/t/12placeholders.t,v
retrieving revision 1.15
diff -u -r1.15 12placeholders.t
--- t/12placeholders.t 4 Mar 2005 03:03:00 -0000 1.15
+++ t/12placeholders.t 6 Mar 2005 12:20:13 -0000
@@ -40,7 +40,7 @@
checkquote('four');
my $sth = $dbh->prepare(qq{INSERT INTO dbd_pg_test (id,pname) VALUES
(?, ?)});
-$sth->execute(100, $quo);
+$sth->execute(100, "\\'?:");
my $sql = "SELECT pname FROM dbd_pg_test WHERE pname = $quo";
$sth = $dbh->prepare($sql);