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

From: Stephen Wong (Stephen.J.Wong at motorola.com)
Date: Wed Mar 24 16:56:33 EST 2004

Hi Bruce,

Thanks for the reply. I looked at the spgsql.ss file and found out the 
pg-connect is not an implemented method, hence the undefined identifier 
error. It seems to be a case of the documentation leading the 
development rather than the other way round ...

Thanks again,

Stephen

Bruce Hauman wrote:

> 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:
>
> (connect HOST PORT DB USER PWD)
>
> 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")))
>
> Bruce
>
>> 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.