# Postgres Connection Error after MacOS-Update

**URL:** <https://forum.elixirforum.com/t/postgres-connection-error-after-macos-update/51845>\
**Category:** Questions\
**Tags:** phoenix, postgres, troubleshooting, learning-elixir\
**Created:** [November 16, 2022, 6:16pm UTC](https://forum.elixirforum.com/t/postgres-connection-error-after-macos-update/51845 "2022-11-16T18:16:15Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![nickname822](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/n/c0e974/32.png) [@nickname822](https://forum.elixirforum.com/u/nickname822)\
**Post date:** [November 16, 2022, 6:16pm UTC](https://forum.elixirforum.com/t/postgres-connection-error-after-macos-update/51845/1 "2022-11-16T18:16:15Z")

</div>

Hello all,

after updating my Mac to the latest OS-Version (Ventura 13.0.1), the following error appears after running `mix phx.server`:

`[error] Postgrex.Protocol (#PID<0.405.0>) failed to connect: ** (Postgrex.Error) FATAL 28000 (invalid_authorization_specification) role "postgres" does not exist`

It worked fine the day before and literally no changes were made 🙂

After running `psql -l` I can sear the user “postgres”.

This topic seems to be related to the following: ['mix ecto.create' errors with: role "postgres" does not exist](https://forum.elixirforum.com/t/mix-ecto-create-errors-with-role-postgres-does-not-exist/20624), But the solution presented there don’t work for me.

Can anyone help? Did anyone have the same problem ?

Any help is appreciated 🙂

Thanks.

---

<div class="post-metadata">

**Author:** ![odix67](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/odix67/32/19855_2.png) [@odix67](https://forum.elixirforum.com/u/odix67)\
**Post date:** [November 16, 2022, 8:46pm UTC](https://forum.elixirforum.com/t/postgres-connection-error-after-macos-update/51845/2 "2022-11-16T20:46:32Z")

</div>

First, how do you installed PostgreSQL ?  
In the case you installed it with brew, install or update xcode-command-line utilites, and reinstall PostgreSQL, this might help

---

<div class="post-metadata">

**Author:** ![maz](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/maz/32/6075_2.png) [@maz](https://forum.elixirforum.com/u/maz)\
**Post date:** [November 17, 2022, 1:33am UTC](https://forum.elixirforum.com/t/postgres-connection-error-after-macos-update/51845/3 "2022-11-17T01:33:30Z")

</div>

Does this work?

> **[Postgres.app – the easiest way to get started with PostgreSQL on the Mac](https://postgresapp.com/)**
>
> Postgres.app is a full featured PostgreSQL installation packaged as a standard Mac app.

---

<div class="post-metadata">

**Author:** ![odix67](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/odix67/32/19855_2.png) [@odix67](https://forum.elixirforum.com/u/odix67)\
**Post date:** [November 17, 2022, 6:12am UTC](https://forum.elixirforum.com/t/postgres-connection-error-after-macos-update/51845/4 "2022-11-17T06:12:53Z")

</div>

fully agree, supports different server versions of PostgreSQL, also using docker is an option

---

<div class="post-metadata">

**Author:** ![nickname822](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/n/c0e974/32.png) [@nickname822](https://forum.elixirforum.com/u/nickname822)\
**Post date:** [November 17, 2022, 7:05am UTC](https://forum.elixirforum.com/t/postgres-connection-error-after-macos-update/51845/5 "2022-11-17T07:05:47Z")

</div>

Thanks for the reply. I installed it with brew. Reinstall didn’t change anything…

---

<div class="post-metadata">

**Author:** ![nickname822](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/n/c0e974/32.png) [@nickname822](https://forum.elixirforum.com/u/nickname822)\
**Post date:** [November 17, 2022, 7:11am UTC](https://forum.elixirforum.com/t/postgres-connection-error-after-macos-update/51845/6 "2022-11-17T07:11:03Z")

</div>

Thank you. I will give it a try. I have it installed but am having some problems starting it up. Will look at it later

---

<div class="post-metadata">

**Author:** ![markmark206](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/markmark206/32/23227_2.png) [@markmark206](https://forum.elixirforum.com/u/markmark206)\
**Post date:** [November 17, 2022, 7:51am UTC](https://forum.elixirforum.com/t/postgres-connection-error-after-macos-update/51845/7 "2022-11-17T07:51:52Z")

</div>

In case it is useful to capture this here, we run postgres in docker on our dev machines (both for `mix test` and for running our application locally), and here are the commands we use to rebuild it:

```elixir
$ docker rm -fv my-postgres
$ docker run --name my-postgres -p 5432:5432 -e POSTGRES_PASSWORD=postgres -d postgres

```

and here is how we start psql shell in the container:

```elixir
$ docker exec -it my-postgres psql -U postgres
psql (14.1 (Debian 14.1-1.pgdg110+1))
Type "help" for help.

postgres=#

```

or, to immediately connect to the db:

```elixir
$ docker exec -it my-postgres psql -U postgres my_db_dev

```

---

<div class="post-metadata">

**Author:** ![evadne](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/evadne/32/13949_2.png) [@evadne](https://forum.elixirforum.com/u/evadne)\
**Post date:** [November 17, 2022, 7:10pm UTC](https://forum.elixirforum.com/t/postgres-connection-error-after-macos-update/51845/8 "2022-11-17T19:10:37Z")

</div>

> [@nickname822](#):
>
> after updating my Mac

Best if you can reinstall Postgres in-situ; macOS upgrades are known to wreak havoc with third party software. Once reinstalled, you can verify that the system works and the role exists via `psql`.

---

<div class="post-metadata">

**Author:** ![nickname822](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/n/c0e974/32.png) [@nickname822](https://forum.elixirforum.com/u/nickname822)\
**Post date:** [November 18, 2022, 10:05am UTC](https://forum.elixirforum.com/t/postgres-connection-error-after-macos-update/51845/9 "2022-11-18T10:05:55Z")

</div>

Thank you, reinstall did work after the second try 🙂

It is a bit annoying that updating the OS-Version leads to such problems…

---

<div class="post-metadata">

**Author:** ![outlog](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/o/c0e974/32.png) [@outlog](https://forum.elixirforum.com/u/outlog)\
**Post date:** [November 18, 2022, 12:04pm UTC](https://forum.elixirforum.com/t/postgres-connection-error-after-macos-update/51845/10 "2022-11-18T12:04:08Z")

</div>

> [@nickname822](#):
>
> It is a bit annoying that updating the OS-Version leads to such problems…

fwiw I’ve been using [https://postgresapp.com](https://postgresapp.com) for pretty much a decade - same install - multiple upgrades (both OS and postgres(app)) - never any issue.. so highly recommended..
