Problems making client perl connection to postgres server

From: fredj132(at)googlemail(dot)com
To: pgsql-general(at)postgresql(dot)org
Subject: Problems making client perl connection to postgres server
Date: 2008-02-29 21:01:02
Message-ID: 3dc100e0-7790-4031-b291-368c98d9d65b@q78g2000hsh.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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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¦ 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)

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Shane Wright 2008-02-29 21:31:40 Re: Upgrade to 8.3.0?
Previous Message hubert depesz lubaczewski 2008-02-29 20:56:43 Re: SERIAL and Primary Key