ts-postgres icon indicating copy to clipboard operation
ts-postgres copied to clipboard

Connection to docker container using PostgreSQL 14 blocks forever and never succeeds

Open bgeisberger opened this issue 4 years ago • 2 comments

I'm creating a container using docker run --rm -it -p "5432:5432" -e POSTGRES_PASSWORD=12345 postgres with the latest docker image (currently version 14).

Then I'm trying to connect using

const pgClient = new Client({
      database: 'postgres',
      host: 'localhost',
      user: 'postgres',
      password: '12345',
      port: 5432,
    });
 
await pgClient.connect();

This takes forever. Using an older container with PostgreSQL 13, this exact same example works. The connection to a PostgreSQL 14 container also succeeds when the authentication method is set to TRUST, but this is no acceptable workaround for me.

I'm pretty sure there has to be some kind of a bug in this library, as a very similar code using pg (node-postgres) works fine also with the latest version of postgres.

bgeisberger avatar Oct 11 '21 09:10 bgeisberger

Looks like it. I'll find some time to test on PostgreSQL 14 asap.

malthe avatar Oct 11 '21 09:10 malthe

This has been fixed in abc544278124701fd0f8c07a57272d9680c1366d and will be released shortly.

malthe avatar Dec 20 '21 08:12 malthe