I was running Perl 5.8 on OSX 10.5 with PostgreSQL 8.3.7.
I upgraded to OSX 10.6, which brought Perl 5.10 with it.
I made sure the modules I need were installed in 5.10.
I installed DBD-Pg-2.15.1 and DBI-1.609.

When I run this code

#!/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 get this 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
I searched around, tried some environment variable suggestions, reinstalled Postgres, uninstalled and reinstalled modules yet still get that PQconnectdb error.

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


In reply to PQconnectdb issue in DBI, using OSX 10.6, Perl 5.10, PostgreSQL 8.3 by dwhite20899

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.