AWS is deprecating postgres 12 that we are currently running so I blindly upgraded to version 16 on the staging server just to see if anything fails before doing the same to the production server.

I then noticed an error:

FATAL 28000 (invalid_authorization_specification) no pg_hba.con f entry for host

Upon searching I came across This stackoverflow response that indicated that Posgres version > 15 now require secure connections which had not been enabled. At this point there are two options, securely connect or disable this requirement (I went for the easier option)

Disabling secure connection

This was the quick fix and how RDS does it it through parameter groups which you need to edit.

  • create a new parameter group, set the rds.force_ssl=0 ensure you assign it to the database engine version you are interested in
  • modify the database instance you want to reassign the new parameter group
  • ensure you restart the instance for changes to take effect

Thats it!! Now I can connect