Re: Mac OS X 10.6 - libpq.dylib vs. libpq.a and PQisthreadsafe() - Mailing list pgsql-general

From David McKeone
Subject Re: Mac OS X 10.6 - libpq.dylib vs. libpq.a and PQisthreadsafe()
Date
Msg-id 58CE7D7C-15FB-4D1C-B9A6-F2410FCB5A20@artsman.com
Whole thread Raw
In response to Re: Mac OS X 10.6 - libpq.dylib vs. libpq.a and PQisthreadsafe()  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On 2011-10-17, at 4:23 PM, Tom Lane wrote:

Hm, is there a libpq dylib in /usr/lib?  If so, maybe it's capturing the
reference?  "otool -L main" would be informative about which dylib is
actually getting called, I think.  If it's not what you expected, the
lack of a -L switch in your link command is probably the reason.

regards, tom lane

Here is the output for otool -L for both.

Static libpq.a

main:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)


Dynamic libpq.5.4.dylib using -lpq

main:
libpq.5.dylib (compatibility version 5.0.0, current version 5.4.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)

Dynamic libpq.5.4.dylib using the command from the previous email  (This one is interesting because /usr/local/pgsql doesn't exist on this machine)

main:
/usr/local/pgsql/lib/libpq.5.dylib (compatibility version 5.0.0, current version 5.4.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)


I did have a libpq.5.dylib in /usr/lib and it turns out that that was the problem.  So it looks like, even though I was specifying the library, it just picked the one at /usr/lib version anyway.  (I obviously have much more to learn about how the linker works on OS X)

The solution was to move the Enterprise DB libpq.5.4.dylib into /usr/lib (and create associated symlinks) and it worked correctly after that.

Thanks for pointing me in the right direction.







pgsql-general by date:

Previous
From: Lincoln Yeoh
Date:
Subject: Re: 9.1 got really fast ;)
Next
From: Viktor Rosenfeld
Date:
Subject: Use true and false when bulk-exporting boolean data