Search Postgresql Archives

Problems making client perl connection to postgres server

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I need to connect a windows client running activestate perl 5.8.8 to a
postgres database running on windows 2003 server. I have loaded DBI:pg
module and DBD with various degrees of success. When I run a simple
test script to make a connection to the postgres database I get the
error:

H:\Src\Perl>perl pg1.pl
The procedure entry point Perl_newXS_flags could not be located in the
dynamic link library perl58.dll.

install_driver(Pg) failed: Can't load 'C:/Perl/site/lib/auto/DBD/Pg/
Pg.dll' for module DBD::Pg: load_file:The specified procedure
could not be found at C:/Perl/lib/DynaLoader.pm line 230.
 at (eval 4) line 3
Compilation failed in require at (eval 4) line 3.
Perhaps a required shared library or dll isn't installed where
expected
 at pg1.pl line 24




#
#
# a simple test script for connecting to the default
# PostgreSQL database.
#
# Copyright 2000 DVL Software Limited
#
# see http://freebsddiary.org/postgresql-perl.html
#

use DBI;
use strict;

my $dbh;
my $sth;
my @vetor;
my $field;

$dbh = DBI->connect("DBI:Pg:dbname=collector; host=myhost",
"postgres", "postgres");
if ($dbh) {
   print "connected\n";

   $sth = $dbh->prepare("SELECT * from table limit 20");
    if (!defined($sth)) {
        print "Cannot prepare $DBI::errstr\n";
    }
    if (!$sth->execute) {
        print "Cannot execute $DBI::errstr\n";
    }



   print "<table>\n";
   while (@vetor = $sth->fetchrow) {
      print "<TR>\n";
      foreach $field (@vetor) {
         print "<TD VALIGN=TOP>$field</TD>\n";
      }
      print "</TR>\n";
   }

   print "</table>\n";

   $sth->finish;
   $dbh->disconnect();
} else {
   print "Cannot connect to Postgres server: $DBI::errstr\n";
   print " db connection failed\n";
}


H:\Src\Perl>ppm list
+-----------------------------------------------------------------+
¦ name                     ¦ version    ¦ files ¦ size     ¦ area ¦
+--------------------------+------------+-------+----------+------¦
¦ ActivePerl-Config        ¦ 1.0        ¦     2 ¦    11 KB ¦ perl ¦
¦ ActivePerl-DocTools      ¦ 2.0        ¦    13 ¦    63 KB ¦ perl ¦
¦ ActivePerl-PPM           ¦ 4.1        ¦    62 ¦   563 KB ¦ perl ¦
¦ ActiveState-RelocateTree ¦ 1.3        ¦     4 ¦    29 KB ¦ perl ¦
¦ ActiveState-Scineplex    ¦ 1.01       ¦     7 ¦    84 KB ¦ perl ¦
¦ ActiveState-Utils        ¦ 2.2        ¦    21 ¦   108 KB ¦ perl ¦
¦ Archive-Tar              ¦ 1.30-r1    ¦     8 ¦    82 KB ¦ perl ¦
¦ Archive-Zip              ¦ 1.18       ¦    16 ¦   159 KB ¦ perl ¦
¦ Compress-Zlib            ¦ 1.42       ¦     7 ¦   121 KB ¦ perl ¦
¦ DBD-Pg                   ¦ 2.0        ¦     8 ¦   923 KB ¦ site ¦
¦ DBD-SQLite               ¦ 1.13       ¦     6 ¦   308 KB ¦ perl ¦
¦ DBI                      ¦ 1.52-r1    ¦    44 ¦  1179 KB ¦ perl ¦
¦ Data-Dump                ¦ 1.08       ¦     2 ¦    13 KB ¦ perl ¦
¦ Digest-HMAC              ¦ 1.01       ¦     4 ¦     5 KB ¦ perl ¦
¦ Digest-MD2               ¦ 2.03       ¦     6 ¦    29 KB ¦ perl ¦
¦ Digest-MD4               ¦ 1.5-r1     ¦     6 ¦    38 KB ¦ perl ¦
¦ Digest-SHA1              ¦ 2.11       ¦     6 ¦    38 KB ¦ perl ¦
¦ File-CounterFile         ¦ 1.04       ¦     2 ¦     6 KB ¦ perl ¦
¦ Font-AFM                 ¦ 1.19       ¦    14 ¦    38 KB ¦ perl ¦
¦ HTML-Parser              ¦ 3.56       ¦    12 ¦   129 KB ¦ perl ¦
¦ HTML-Tagset              ¦ 3.10       ¦     2 ¦    13 KB ¦ perl ¦
¦ HTML-Tree                ¦ 3.23       ¦    10 ¦   315 KB ¦ perl ¦
¦ IO-String                ¦ 1.08       ¦     2 ¦    12 KB ¦ perl ¦
¦ IO-Zlib                  ¦ 1.04       ¦     2 ¦    16 KB ¦ perl ¦
¦ LWP                      ¦ 5.805-r2   ¦    63 ¦   568 KB ¦ perl ¦
¦ MD5                      ¦ 2.03       ¦     2 ¦     1 KB ¦ perl ¦
¦ MIME-Base64-Scripts      ¦ 1.00       ¦     9 ¦     3 KB ¦ perl ¦
¦ Math-BigInt-FastCalc     ¦ 0.10       ¦     6 ¦    31 KB ¦ perl ¦
¦ Perl                     ¦ 5.8.8.820  ¦  1529 ¦ 24167 KB ¦ perl ¦
¦ SOAP-Lite                ¦ 0.55-r1    ¦    29 ¦   332 KB ¦ perl ¦
¦ Tcl                      ¦ 0.89-r2    ¦     8 ¦  2483 KB ¦ perl ¦
¦ Term-ReadKey             ¦ 2.30       ¦     7 ¦    48 KB ¦ perl ¦
¦ Term-ReadLine-Perl       ¦ 1.0302-r1  ¦     3 ¦   139 KB ¦ perl ¦
¦ Text-Autoformat          ¦ 1.13       ¦     2 ¦    43 KB ¦ perl ¦
¦ Text-Reform              ¦ 1.11       ¦     7 ¦    60 KB ¦ perl ¦
¦ Tk                       ¦ 804.027-r6 ¦   693 ¦  6013 KB ¦ perl ¦
¦ Tkx                      ¦ 1.04       ¦     9 ¦    68 KB ¦ perl ¦
¦ URI                      ¦ 1.35       ¦    50 ¦   116 KB ¦ perl ¦
¦ Unicode-String           ¦ 2.09       ¦     7 ¦   605 KB ¦ perl ¦
¦ Win32-AuthenticateUser   ¦ 0.02       ¦     7 ¦    26 KB ¦ perl ¦
¦ XML-Parser               ¦ 2.34-r1    ¦    32 ¦   487 KB ¦ perl ¦
¦ XML-Simple               ¦ 2.16       ¦     3 ¦   112 KB ¦ perl ¦
¦ libwin32                 ¦ 0.26-r3    ¦   154 ¦  2181 KB ¦ perl ¦
+-----------------------------------------------------------------+
 (43 packages installed)

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
       message can get through to the mailing list cleanly


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux