PostgreSQL migration issue in AWS RDS with Drizzle ORM: 'no pg_hba.conf entry for host' error
I've been using drizzle for a new project over the past few weeks, and it has provided a great developer experience. Now, it's time to bring the app to production. However, I'm currently facing an issue with the migrations.
The app is deployed in AWS ECS and connects to a PostgreSQL database in AWS RDS. I have provided the necessary IAM policies in the ECS task role to access the RDS instance. The connection is established but after that when I execute the migrate function, I'm encountering an error that I didn't experience while running locally.
I tried changing postgres client.
I had never experienced such issue when using other ORMs like Prisma and TypeORM. Is this something specific to how Drizzle executes SQL in Postgres?
3 Replies
https://www.postgresql.org/docs/current/auth-pg-hba-conf.html < Seems like postgres is unable to auth using your credentials, and is trying to fall back to this. So you have some actual code of you setting up the connection? I think both pg.pool and postgres.js only (try to) connect when a first query is done, so this is probably still a connection error
PostgreSQL Documentation
21.1. The pg_hba.conf File
21.1. The pg_hba.conf File Client authentication is controlled by a configuration file, which traditionally is named pg_hba.conf and is stored in …
i am facing same issue. Switched to prisma and my queries are running fine. Drizzle works for migration but queries are failing
This will be an SSL issue, there are extra steps to add the root certificates from RDS in order to allow connections to be verified.
See a related thread with details on how to configure SSL https://discord.com/channels/1043890932593987624/1128455867021398087/1141231166754664509