To build your libpq programs for MzScheme, put the following line in them:
(require (lib "libpq-fe.scm" "libpq"))(assuming you installed the collection as described below).
To build (i.e., compile and link) your libpq collection you need to do all of the following things:
Unpack the collection into your collections directory:
tar -xzvf libpq.tgz
Check and possibly modify the pathnames in Makefile, using the utility pg_config, e.g. to find out where the header files are on the local system use:
$ pg_config --includedir /usr/local/includeand to find out the library directory use:
$ pg_config --libdir /usr/local/pgsql/lib
Just call make to compile the collection (it must be compiled, as it contains FFI code).
You may check everything using test programs from test-libpq subdirectory.