Author: turnstep
Date: Tue Jan 15 16:14:31 2008
New Revision: 10560

Modified:
   DBD-Pg/trunk/Pg.pm

Log:
Make data_sources use DBI_DSN if defined.


Modified: DBD-Pg/trunk/Pg.pm
==============================================================================
--- DBD-Pg/trunk/Pg.pm  (original)
+++ DBD-Pg/trunk/Pg.pm  Tue Jan 15 16:14:31 2008
@@ -147,6 +147,9 @@
                my $attr = shift || '';
                ## Future: connect to "postgres" when the minimum version we 
support is 8.0
                my $connstring = 'dbname=template1';
+               if ($ENV{DBI_DSN}) {
+                       ($connstring = $ENV{DBI_DSN}) =~ s/dbi:Pg://;
+               }
                if (length $attr) {
                        $connstring .= ";$attr";
                }

Reply via email to