'mix ecto.create' errors with: role "postgres" does not exist

Hi guys! I got the same error:

16:05:28.295 [error] GenServer #PID<0.220.0> terminating
** (Postgrex.Error) FATAL 28000 (invalid_authorization_specification) no PostgreSQL user name specified in startup packet
    (db_connection) lib/db_connection/connection.ex:84: DBConnection.Connection.connect/2
    (connection) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message: nil
State: Postgrex.Protocol
** (Mix) The database for Getaways.Repo couldn't be created: killed

and fixed it. It was due to the config on the dev.exs file (at the end of it):

Originally:

# Configure your database
config :getaways, Getaways.Repo,
  username: "postgres",
  password: "postgres",
  database: "getaways_dev",
  hostname: "localhost",
  pool_size: 10

Fixed:

# Configure your database
config :getaways, Getaways.Repo,
  username: "yourcomputeruser",
  password: "yourcomputeruser",
  database: "getaways_dev",
  hostname: "localhost",
  pool_size: 10

The setup by default is “postgres” => updated them to my computer user.

I hope it helps!