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

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Thu Jan 1 05:25:52 EST 2015

Thomas Lynch wrote on 01/01/2015 03:30 AM:
> 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.
>

Is `psql` is using a Unix domain socket to talk to PG, 
`postgresql-connect` is using a `localhost` TCP port to PG, and your 
`/etc/postgresql/*/main/pg_hba.conf` is configured to have different 
authentication for the two different methods?

If so, try either adding `#:socket 'guess` to your `postgresql-connect` 
call, or modifying your `pg_hba.conf` (and restarting PG).

If that's not quite it, try also adding `#:ssl 'yes` to 
`postgresql-connect`, or modifying `pg_hba.conf` again.

If that's not it, check for PG environment variables that `psql` could 
be using.  Also, you can test the different methods by supplying 
different `conninfo` strings on the `psql` command line.

Neil V.


Posted on the users mailing list.