如何通过自制程序更改在macOS上安装的Postgresql数据库位置

C0D*_*F52 5 database postgresql macos homebrew

我有通过自制软件安装在macOS系统驱动器上的postgresql数据库。系统驱动器不是很大,数据库也越来越大。如果可能,我想将其移至大数据驱动器。我已经找到了Ubuntu的手册,但似乎不适合我的情况。因为它说postgresql.conf位于数据库本身以外的其他目录中。但是自制软件的数据库位于/ usr / local / var / postgres中,其中包含postgresql.conf。所以我想我不能仅仅将/ usr / local / var / postgres目录移动到另一个地方,因为postgresql.conf将无法访问。

Kei*_*son 2

您可以使用 ln 从外部驱动器映射目录。

  • 就我而言,我将目录 /usr/local/var/postgres 移动到我的数据卷 /Volumes/data/postgres 并使用以下命令将其链接到 var 中: ln -s /Volumes/data/postgres /usr/local/var/ postgres (5认同)