---
title: "Homebrewでpostgresデータベースをアップグレードする"
description: "postgresをアップグレードするには次を実行します"
canonical: https://oozou.com/til/upgrade-postgres-database-with-homebrew-76
locale: ja
date: 2020-10-22
topic: shell
---

# Homebrewでpostgresデータベースをアップグレードする

> postgresをアップグレードするには次を実行します

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

postgresをアップグレードするには次を実行します

```shell
brew upgrade postgresql
```

実行後、既存のデータベースには新しいpostgresバイナリと互換性のないデータが残ります。通常なら pg\_update に正しいバイナリを渡してデータを移行しなければなりませんが、brewにはデータを更新してくれるアップグレードスクリプトが含まれています。

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

---

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

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