When I run this code
I get this error#!/usr/bin/perl -w use strict; use DBI; use DBD::Pg; use vars qw( @ImagesList ); my $dbh = DBI->connect("dbi:Pg:dbname='wonkaDB';host='192.168.1.1'", + 'willy', 'pwd0ompa') ; if ( !$dbh ) { die "ERROR: Cannot connect to database.\n\n"; } print "connected to database.\n"; my $sql_cmd = "select image from media_state where attempted IS +NULL limit 7 "; my $sth = $dbh->prepare($sql_cmd); $sth->execute() or die "Execute for media_state has failed.\n"; if ($sth->rows > 0 ) { my @fet_row = $sth->fetchrow_array; while ( @fet_row = $sth->fetchrow_array) { push(@ImagesList, $fet_row[0]); } } else { print("No images found in media_state table\n"); } $dbh->disconnect(); print join("\n",@ImagesList); exit;
I searched around, tried some environment variable suggestions, reinstalled Postgres, uninstalled and reinstalled modules yet still get that PQconnectdb error.dyld: lazy symbol binding failed: Symbol not found: _PQconnectdb Referenced from: /Library/Perl/5.10.0/darwin-thread-multi-2level/aut +o/DBD/Pg/Pg.bundle Expected in: flat namespace dyld: Symbol not found: _PQconnectdb Referenced from: /Library/Perl/5.10.0/darwin-thread-multi-2level/aut +o/DBD/Pg/Pg.bundle Expected in: flat namespace Trace/BPT trap
What am I missing, here? This isn't rocket surgery.
Update: I'm going to go wander off and see what's in 32 and 64 bit territory. Will report back later...
Update (later): I uninstalled PostgreSQL, uninstalled the DBD and DBI modules; then installed PostgreSQL 8.3.7 from source again (it recognized 64-bit) and DBI and DBD::Pg, and everything works. Looking at the logs, I don't see anything different from Friday's installs, but it's happy now. (I'm not happy, but I guess I don't count.)
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |