NodeJS Postgres error getaddrinfo ENOTFOUND

后端 未结 4 496
鱼传尺愫
鱼传尺愫 2021-01-04 21:16

I use pg://user:pass@localhost:port/table for connecting to my AWS database. When I use localhost, the app works fine, but when I try to connect the AWS server

4条回答
  •  一向
    一向 (楼主)
    2021-01-04 21:52

    If it helps anyone, I had this problem trying to connect to a postgres db on AWS from an API hosted on Heroku using the pg npm package. I changed by PGHOST environmental variable from https://aws-sondayy-prod.caoqasdfsdftwur.us-east-2.rds.amazonaws.com to aws-sondayy-prod.caoqasdfsdftwur.us-east-2.rds.amazonaws.com (ie removed the https://) and it started working.

提交回复
热议问题