PostgreSQL 8 and DBI, DBD::Pg
Say, has anyone used the above combination... successfully?
I recently compiled PostgreSQL 8 on a SuSE 9.2 system and haven't been having much luck getting a formerly working Perl script to be able to connect to the database since the database upgrade. Software versions: SuSE 9.2, Pg 8.0.0 (compiled from sources w/ ./configure --with-perl), DBI-1.43-2 (from the 9.2 CDs), and DBD::Pg-1.22-198 (downloaded from Novell/SuSE site). The line that's failing is: Code:
$dbh = DBI->connect("dbi:Pg:dbname=$db", "", "", "") || die $DBI::errstr; Code:
Can't use string ("") as a HASH ref while "strict refs" in use at /usr/lib/perl5/site_perl/5.8.5/i586-linux-thread-multi/DBI.pm line 515. If I change that line to use a couple of variables containing username and password info: Code:
$dbh = DBI->connect("dbi:Pg:dbname=$db", $username, $password, {RaiseError => 1}) || die $DBI::errstr; This seems awfully weird to me that this interface would now be this broken; especially when when of the main PostgreSQL developers is an admin on the DBD::Pg project. So... Anyone got any experience along these lines? Pg 8 is pretty new so I guess it's possible that the perl interface hasn't caught up yet so I'm monitoring traffic on as many Pg sites as I can find in case something turns up.) Could this be a SuSE 9.2 problem? TIA -- PS. If the above is littered with weird "+ACQ-" and similar strings and the like, will someone please explain how the heck you're supposed to be able to post code with some silly parser mucking it up all the time? |
You might want to try DBIx::Password to hold all the handle information before you make the DBI connection. Make sure it comes before the code that tries to use it!
|
All times are GMT -5. The time now is 09:12 PM. |