简体   繁体   English

如何在Amazon Linux AMI上安装postgres10工具

[英]How to install postgres10 tools on Amazon Linux AMI

I need to use pg_dump for postgres 10.4 on my EC2 instance. 我需要在我的EC2实例上使用pg_dump for postgres 10.4。 My AMI version is: 我的AMI版本是:

$ cat /etc/system-release Amazon Linux AMI release 2018.03

I've tried to get it from this repo: https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-redhat10-10-2.noarch.rpm , then install postgres tools by command sudo yum install postgres10 but it works only for Amazon Linux 2. 我试图从这个回购中得到它: https//download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-redhat10-10-2.noarch.rpm ,然后通过命令sudo yum install postgres10安装postgres工具,但它仅适用于Amazon Linux 2。

Do you have any idea how can I get Postgres10 for my instance? 你知道如何为我的实例获取Postgres10吗?

I haven't been able to find any existing packages for version 10, here is how I compiled the client tools myself on the 2018.03 AMI 我无法找到任何现有的版本10的软件包,这是我在2018.03 AMI上自己编译客户端工具的方法

sudo yum install -y gcc readline-devel zlib-devel

wget https://ftp.postgresql.org/pub/source/v10.4/postgresql-10.4.tar.gz
tar -xf postgresql-10.4.tar.gz
cd postgresql-10.4

./configure
make -C src/bin
sudo make -C src/bin install

make -C src/include
sudo make -C src/include install

make -C src/interfaces
sudo make -C src/interfaces install

make -C doc
sudo make -C doc install

After this you can run pg_dump from /usr/local/pgsql/bin/pg_dump or alternatively add /usr/local/pgsql/bin to your PATH to run pg_dump anywhere 在此之后,您可以从/usr/local/pgsql/bin/pg_dump运行pg_dump ,或者将/usr/local/pgsql/binPATH以在任何地方运行pg_dump

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM