Default password for my user in postgresql Default password for my user in postgresql postgresql postgresql

Default password for my user in postgresql


As per tadman's comment, Homebrew postgres currently creates an account with the same name as the installing user, but no password. E.g. after my initial install (username david):

$ psql postgrespsql (12.2)Type "help" for help.postgres=# \du                                   List of roles Role name |                         Attributes                         | Member of -----------+------------------------------------------------------------+----------- david     | Superuser, Create role, Create DB, Replication, Bypass RLS | {}


There are two different "accounts" here:

  1. The OS X user that owns the PostgreSQL files and processes. When you installed PostgreSQL, you used your own user account for that.

  2. The PostgreSQL user that can log in to the PostgreSQL database. By default, that user is internal to your PostgreSQL instance and has nothing to do with any OS X user.

For psql, you need #2. Immediately after installation, there should be a user named "postgres" with no password that has full administrative privileges - try logging in with those credentials (and change the password to something secure ASAP).


When installing on a mac via homebrew, the default user that is created is named the same as your mac's user account. There is no password, and running psql should get you in.

If not, you likely ALSO have the postgres application installed. If you uninstall the application it will no longer have issues with clashing users.