On Thu, 19 Apr 2001 10:52:31 +1200, Glen Eustace alluded:
> I have just upgraded to the new DBD, but am still using postgresql 7.0.3
>
> I am now getting access errors. I have had to go back into the db and
> GRANT ALL on <ALL> to PUBLIC as a work around.
>
> Even though I have specified a userid and password on the DBI->connect,
> Pg seems to be using the actual user.
There's a bug in the authentication code in DBD::Pg 0.96. Here's a patch:
--- Pg.dist Wed Apr 18 20:18:18 2001
+++ Pg.pm Wed Apr 18 20:20:18 2001
@@ -79,11 +79,11 @@
$Name =~ s/^.*dbname\s*=\s*//;
$Name =~ s/\s*;.*$//;
+ $user = $ENV{DBI_USER} unless defined($user) and length($user);
+ $auth = $ENV{DBI_PASS} unless defined($auth);
+
$user = "" unless defined($user);
$auth = "" unless defined($auth);
-
- $user = $ENV{DBI_USER} unless $user eq "";
- $auth = $ENV{DBI_PASS} unless $auth eq "";
my($dbh) = DBI::_new_dbh($drh, {
'Name' => $Name,
Jeff Duffy
jduffy@greatbridge.com