Package: libpg-perl
Version: 1:2.1.1-3
Severity: normal
Tags: patch

use Pg;
my $conn = Pg::connectdb('dbname="fooTM"');

does not work:
FATAL:  database ""footm"" does not exist

It is a problem of libpg-perl, because 

psql fooTM

does work.

According to 

http://gborg.postgresql.org/project/pgperl/bugs/bugupdate.php?810

this is a known bug (but seems to be open for three years). That bugreport
proposes to one line fix. On the other hand, the code in Pg.xs does not check 
the 
parameters carefully, so I'd suggest to apply the following patch:

diff -ur libpg-perl-2.1.1/Pg.xs libpg-perl-2.1.1new/Pg.xs
--- libpg-perl-2.1.1/Pg.xs      2004-04-20 05:25:06.000000000 +0200
+++ libpg-perl-2.1.1new/Pg.xs   2007-10-17 20:01:42.000000000 +0200
@@ -96,8 +96,11 @@
                char *ptr = strstr(conninfo, "dbname");
                if (ptr) {
                    ptr += 6;
-                   while (*ptr && *ptr != '=') {
-                       ptr++;
+                   while (*ptr && (*ptr == ' ' || *ptr == '\t')) {
+                       ptr++;
+                   }
+                   if (*ptr && *ptr == '=' ) {
+                       ptr++;
                    }
                    while (*ptr && (*ptr == ' ' || *ptr == '\t')) {
                        ptr++;

(I tested it and it does work for me).




-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-5-xen-amd64
Locale: LANG=de_AT.UTF-8, LC_CTYPE=de_AT.UTF-8 (charmap=UTF-8)

Versions of packages libpg-perl depends on:
ii  libc6                  2.3.6.ds1-13etch2 GNU C Library: Shared libraries
ii  libpq4                 8.1.9-0etch1      PostgreSQL C client library
ii  perl                   5.8.8-7           Larry Wall's Practical Extraction 
ii  perl-base [perlapi-5.8 5.8.8-7           The Pathologically Eclectic Rubbis

libpg-perl recommends no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to