[plt-scheme] spgsql "reference to undefined identifier: pg-connect" error

From: Bruce Hauman (bhauman at cs.wcu.edu)
Date: Wed Mar 24 12:51:53 EST 2004

Stephen Wong wrote:
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> Hi everyone,
> I'm a new mzscheme/drscheme user and I'm hoping that this is a trivial 
> problem in experienced hands.
> I'm trying to use spgsql to connect to PostgreSQL which I have verified 
> to be working by accessing it using other language/drivers. I installed 
> spgsql by copying it under the collects directory, did "(require (lib 
> "spgsql.ss" "spgsql"))" as described in the example (this didn't 
> generate any errors), but when I tried to create a connection by 
> evaluating (define cx (pg-connect HOST PORT DB USER PWD)) with 
> appropriate values for the connection parameters, I got the error 
> message "reference to undefined identifier: pg-connect".

You probably just need to use the function name connect as in:


I am have never used spgsql.ss but I am assuming that you looked at code
that was prefixed with a require as below:

(require (prefix 'pg- (lib  "spgsql.ss" "spgsql")))


> Is my installation of spgsql incorrect (calling mzlib libraries such as 
> pregexp is totally functional), or the way I loaded the library, or 
> something else?
> Stephen

Posted on the users mailing list.