Search code examples
postgresqlsecurityauthenticationpasswords

In PostgreSQL, how to accept *any* password for the user "postgres"?


I'm working on many projects simultaneously, and some have some passwords defined as default, which can vary along projects. I've got postgresql installed on my (Ubuntu) laptop and of course I'm only using it locally for devving.

I know it's horribly insecure, but I don't expose postgres remotely. So to make things easier I would like the postgresql server to accept ANY password it is given for the postgres user. Is there any way that I could do this?


Solution

  • Set trust for all you local connections in pg_hba.conf like e.g

    local   all             all                                     trust
    

    After editing, restart the postgresql service.