Connection to docker container using PostgreSQL 14 blocks forever and never succeeds
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.
Looks like it. I'll find some time to test on PostgreSQL 14 asap.
This has been fixed in abc544278124701fd0f8c07a57272d9680c1366d and will be released shortly.