>  That's undetermined: Of course everyone assumes unless we hear
> otherwise that Edmund will continue the great work he's done on
> DBD::Pg.

No news?

>  So here's a call for patches: if anyone else knows of patches to
> DBD::Pg 0.95 send them to me (along with some sort of explanation :)
> and I'll get a pl1 release out.

There's the patch Tom Lane created that fix the problems with large
attributes -- that's clearly a bug fix.

The other possible patch I know of is this one:

    http://mailarchive.activestate.com/mail/msg/perl-DBI:299287

It's a bit less obviously a candidate for a "pl1" release, since it is
removing a (mis-)feature.  I think it's necessary, but it would
perhaps be better kept separately for now.

A cleaned up copy of that patch is below so nobody else has to dig it
out of HTML ... unless they're reading this message as HTML, of
course. :-)

Regards,

Giles

--- DBD-Pg-0.95/Pg.pm-orig   Mon Jul 10 19:47:51 2000
+++ DBD-Pg-0.95/Pg.pm  Mon Aug 28 17:09:04 2000
@@ -867,11 +867,16 @@
 parameters will be escaped in the following way: 
 
   escape quote with a quote (SQL)
-  escape backslash with a backslash except for octal presentation
+  escape backslash with a backslash
 
 The default is on. Note, that PostgreSQL also accepts quotes, which 
 are escaped by a backslash. Any other ASCII character can be used 
 directly in a string constant. 
+
+(Versions of DBD::Pg before 0.95 sometimes tried to leave backslashes
+unescaped when the backslash preceded three digits, so you could pass
+octal escapes to PostgreSQL. It no longer does so, use perl to escape
+octal escapes if you want to).
 
 =item B<pg_INV_READ> (integer, read-only)
 
--- DBD-Pg-0.95/dbdimp.c-orig   Tue Jul 11 03:47:29 2000
+++ DBD-Pg-0.95/dbdimp.c        Tue Apr  3 14:27:11 2001
@@ -1095,8 +1095,8 @@
                     if (*val == '\'') {
                         *dest++ = '\'';
                     }
-                   /* escape backslash except for octal presentation */
-                    if (*val == '\\' && !(isdigit(*(val+1)) && isdigit(*(val+2)) && 
isdigit(*(val+3))) ) {
+                   /* escape backslash */
+                    if (*val == '\\') {
                         *dest++ = '\\';
                     }
                 }

--- DBD-Pg-0.95/test.pl-orig Mon Jun 12 17:12:17 2000
+++ DBD-Pg-0.95/test.pl        Mon Aug 28 17:14:55 2000
@@ -158,7 +158,7 @@
   'f',
   'b',
   'Halli  Hallo',
-  'but  not  \164\150\151\163',
+  'no \123456 esc',
   'Halli  Hallo',
   'Halli  Hallo',
   '1995-01-06',
@@ -241,7 +241,7 @@
     or  print "\$sth->fetchrow_array ....... not ok: ", join(" ", @row_ary), "\n";

 my $ary_ref = $sth->fetchrow_arrayref;
-( join(" ", @$ary_ref) eq q{0 b Halli  Hallo but  not  this   Halli  Hallo Halli  
Hallo 1995-01-06 5678 {5,6,7} 5.678 (4,5) [(4,5),(6,7)] (6,7),(4,5)} )
+( join(" ", @$ary_ref) eq q{0 b Halli  Hallo no \123456 esc   Halli  Hallo Halli  
+Hallo 1995-01-06 5678 {5,6,7} 5.678 (4,5) [(4,5),(6,7)] (6,7),(4,5)} )
     and print "\$sth->fetchrow_arrayref .... ok\n"
     or  print "\$sth->fetchrow_arrayref .... not ok: ", join(" ", @$ary_ref), "\n";




Reply via email to