voxpelli / node-pg-pubsub

A Publish/Subscribe implementation on top of PostgreSQL NOTIFY/LISTEN
https://www.npmjs.com/package/pg-pubsub
MIT License
236 stars 16 forks source link

Password does not match for user "root" #80

Closed niccololampa closed 5 years ago

niccololampa commented 5 years ago

I am trying to connect my postgres via my websocket and my postgres database logs the

password does not match for user "root".
sample-db |  Connection matched pg_hba.conf line 95: "host all all all md5"

My postgres setup is the following:

 image: postgres:11.2-alpine
    container_name: sample-db
    ports:
      - 5432:5432      
    environment:
      POSTGRES_DB: sample_db
      POSTGRES_USER: root
      POSTGRES_PASSWORD: root

How do I properly write the syntax for var pubsubInstance = new PGPubsub('postgres://username@localhost/database') using the postgres credentials above ?

Currenly this is how I wrote it

pubsubInstance = new PGPubsub('postgres://root@localhost:5432/sample_db');

niccololampa commented 5 years ago

Found the answer myself.

var pubsubInstance = new PGPubsub('postgres://username:password@localhost/database')

So in my case:

pubsubInstance = new PGPubsub('postgres://root:root@localhost:5432/sample_db');

voxpelli commented 5 years ago

Great that you managed to find a solution yourself! 🙌

niccololampa commented 5 years ago

Great that you managed to find a solution yourself! 🙌

@voxpelli Haha. Well when in need and desperate you just have to find a way to make it work. 🏄