如何在 arch Linux 中安装 uuid-ossp postgresql 扩展

How to install uuid-ossp postgresql extension in arch Linux

我需要在 arch linux 上安装 uuid-ossp postgresql 扩展。我有 postgresql-9.5。在 ubuntu 上,通过 sudo apt-get install postgresql-contrib 很容易做到,但如何在 arch Linux 中做到这一点?

默认的 postgresql 软件包不提供 ossp-uuid 功能。你必须在编译前通过 ./configure 启用它。所以你有两种方法来获得这个功能:

  1. 自己用 --with-ossp-uuid-flag 编译 postgresql 并通过 make install 安装它。 (我不推荐这个)
  2. 通过工具asp下载postgresql包规范。您可以使用 sudo pacman -Syu asp 安装它,然后执行:asp checkout postgresql。然后你需要修改 PKGBUILD 并在 build() 函数中插入 --with-ossp-uuid 标志。然后你可以简单地构建包并使用 makepkg -si 安装它。您可能需要额外的依赖项。我还没有测试过,但它应该是这样工作的。