---
title: "อัปเกรดฐานข้อมูล postgres ด้วย homebrew"
description: "การอัปเกรด postgres ทำได้โดยรัน"
canonical: https://oozou.com/til/upgrade-postgres-database-with-homebrew-76
locale: th
date: 2020-10-22
topic: shell
---

# อัปเกรดฐานข้อมูล postgres ด้วย homebrew

> การอัปเกรด postgres ทำได้โดยรัน

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

การอัปเกรด postgres ทำได้โดยรัน

```shell
brew upgrade postgresql
```

หลังจากทำเสร็จแล้ว ฐานข้อมูลเดิมจะมีข้อมูลที่เข้ากันไม่ได้กับ binary ตัวใหม่ของ postgres โดยปกติคุณจะต้องใช้ pg\_update พร้อมระบุ binary ที่ถูกต้องเพื่อ migrate ข้อมูล แต่ brew มี Script อัปเกรดที่ช่วยอัปเดตข้อมูลให้คุณอยู่แล้ว

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

---

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

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