[racket] postgres connect problem - unexpected 'password required' error

From: Thomas Lynch (thomas.lynch at reasoningtechnology.com)
Date: Thu Jan 1 03:30:14 EST 2015

I am having difficulty connecting to the postgres server from Racket.  It
asks for a password, but role and authentication is set up so that the
logged in local user does not need one.

1. these versions:

(Debian 4.6.3-14)
Racket 5.2.1
postgres (9.1.14)


2. running psql from a shell prompt doesn't prompt for anything, just works:

> psql
psql (9.1.14)
Type "help" for help.

lynch=> \list
                                  List of databases
   Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access
privileges
-----------+----------+----------+-------------+-------------+-----------------------
 lynch       | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
         +
           |          |          |             |             |
postgres=CTc/postgres
 template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
         +
           |          |          |             |             |
postgres=CTc/postgres
(4 rows)


3. running from racket however, gives an error, saying it needs a password:

racket@> (require db)
racket@> (define pgc (postgresql-connect #:database "lynch" #:user "lynch"))
postgresql-connect: password needed but not supplied
stdin::319: ((checked-procedure-check-and-extract struct:keyword-procedure
pgc keyword-procedure-extract (quote (#:database #:user)) (quote 2)) (quote
(#:database #:user)) (list temp7 temp8))



Ah, so what am I doing wrong here?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20150101/95ed9be1/attachment.html>

Posted on the users mailing list.