---
title: "Upgrade postgres database with homebrew"
description: "To upgrade postgres you can run"
canonical: https://oozou.com/til/upgrade-postgres-database-with-homebrew-76
locale: en
date: 2020-10-22
topic: shell
---

# Upgrade postgres database with homebrew

> To upgrade postgres you can run

Published: 2020-10-22 · Topic: [shell](https://oozou.com/til-topics/shell) ([markdown](https://oozou.com/til-topics/shell.md))

To upgrade postgres you can run

```shell
brew upgrade postgresql
```

After you've done that your existing databases will have data that is incompatible with the your new postgres binary. Normally you would have to use pg\_update and pass in the correct binaries to migrate the data, however, brew includes an upgrade script to update the data for you.

```shell
brew postgresql-upgrade-database
```

---

Contact OOZOU: hello@oozou.com · +66 2544 0000 · https://oozou.com/contact

More for AI agents: https://oozou.com/llms.txt · every page has a markdown twin at its URL plus ".md"
