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

**URL:** <https://forum.elixirforum.com/t/mix-ecto-create-errors-with-role-postgres-does-not-exist/20624>\
**Category:** Questions\
**Tags:** phoenix, postgres, mac\
**Created:** [March 5, 2019, 1:15am UTC](https://forum.elixirforum.com/t/mix-ecto-create-errors-with-role-postgres-does-not-exist/20624 "2019-03-05T01:15:48Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![leifericf](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/leifericf/32/39367_2.png) [@leifericf](https://forum.elixirforum.com/u/leifericf)\
**Post date:** [October 30, 2025, 12:32pm UTC](https://forum.elixirforum.com/t/mix-ecto-create-errors-with-role-postgres-does-not-exist/20624/21 "2025-10-30T12:32:55Z")

</div>

> [@shanesveller](#):
>
> the Homebrew installation creates a SQL user named after your OS user and no “postgres” user to go with it.

Aha! Jupp. That’s what happened in my case.

---

<div class="post-metadata">

**Author:** ![garrison](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/g/3bc359/32.png) [@garrison](https://forum.elixirforum.com/u/garrison)\
**Post date:** [October 30, 2025, 4:08pm UTC](https://forum.elixirforum.com/t/mix-ecto-create-errors-with-role-postgres-does-not-exist/20624/22 "2025-10-30T16:08:29Z")

</div>

It’s probably better to create the `postgres` user in order to keep your dev env portable. This is [actually documented here](https://hexdocs.pm/phoenix/ecto.html#mix-tasks) and linked in the installation guide, but it’s easy to miss.

---

<div class="post-metadata">

**Author:** ![dimitarvp](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/32/38664_2.png) [@dimitarvp](https://forum.elixirforum.com/u/dimitarvp)\
**Post date:** [October 31, 2025, 10:28pm UTC](https://forum.elixirforum.com/t/mix-ecto-create-errors-with-role-postgres-does-not-exist/20624/23 "2025-10-31T22:28:24Z")

</div>

Yeah, that’s what I do as well. I don’t want to have my `dev.exs` file contain personal information (the login username) anyway.

---

<div class="post-metadata">

**Author:** ![leifericf](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/leifericf/32/39367_2.png) [@leifericf](https://forum.elixirforum.com/u/leifericf)\
**Post date:** [November 2, 2025, 11:51am UTC](https://forum.elixirforum.com/t/mix-ecto-create-errors-with-role-postgres-does-not-exist/20624/24 "2025-11-02T11:51:17Z")

</div>

This makes a lot of sense!

---

<div class="post-metadata">

**Author:** ![leifericf](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/leifericf/32/39367_2.png) [@leifericf](https://forum.elixirforum.com/u/leifericf)\
**Post date:** [November 2, 2025, 12:16pm UTC](https://forum.elixirforum.com/t/mix-ecto-create-errors-with-role-postgres-does-not-exist/20624/25 "2025-11-02T12:16:02Z")

</div>

> [@garrison](#):
>
> This is [actually documented here](https://hexdocs.pm/phoenix/ecto.html#mix-tasks) and linked in the installation guide, but it’s easy to miss.

Thanks! I did indeed miss that part of the docs. And now it’s sorted!

[Previous page](https://forum.elixirforum.com/t/mix-ecto-create-errors-with-role-postgres-does-not-exist/20624.md?page=1)
