[Haskell-cafe] getting a DB library working with ghc 6.6 and PostgreSQL 7.4.7

Seth Gordon sethg at ropine.com
Tue Oct 17 09:29:31 EDT 2006

> I installed HDBC, but when I tried running a simple program that used
> it, I get the error message
> ghc-6.6:
> /usr/local/lib/HDBC-postgresql-
> unknown symbol `PQserverVersion'

Ah, I figured it out.  The PQserverVersion function is documented in the
PostgreSQL 8.0 and 8.1 manuals as follows:

"Applications may use this to determine the version of the database
server they are connected to. The number is formed by converting the
major, minor, and revision numbers into two-decimal-digit numbers and
appending them together. For example, version 7.4.2 will be returned as
70402, and version 8.1 will be returned as 80100 (leading zeroes are not
shown). Zero is returned if the connection is bad."

You'd think, from the description, that the libpq for PostgreSQL 7.4
would also have this function.  But it doesn't.

More information about the Haskell-Cafe mailing list