0

Version: psql (PostgreSQL) 9.2.24 - I also downloaded Version 11.8.

to download v 9 I just ran:

sudo apt-get update
sudo apt-get install python-psycopg2
sudo apt-get install postgresql postgresql-contrib

to get v 11 - I followed this github comment:

https://stackoverflow.com/questions/49573258/installing-postgresql-client-v10-on-aws-amazon-linux-ec2-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
The new package should be installed with all its executables in here: /usr/local/pgsql/bin

Now, keep in mind that commands psql, pg_dump etc. still point to the old version of the psql client. You can run with the full executable paths (/usr/local/pgsql/bin/psql) or prepend the new directory at the beginning of your $PATH so that the system will look it up first:

Edit ~/.bash_profile adding this at the end:

export PATH="/usr/local/pgsql/bin:$PATH"
Then run:

source ~/.bash_profile
Now everything should be ready:

[ec2-user@ip-xx-x-x-xxx ~]$ psql --version
psql (PostgreSQL) 10.4

I am running on EC2 - these are details

NAME="Amazon Linux AMI"
VERSION="2018.03"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2018.03"
PRETTY_NAME="Amazon Linux AMI 2018.03"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2018.03:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"

I am trying to try out Airflow and following these guides: https://medium.com/@achilleus/robust-apache-airflow-deployment-dd02a6c75c78

https://medium.com/@abraham.pabbathi/airflow-on-aws-ec2-instance-with-ubuntu-aff8d3206171

Having trouble finding pg_hba.conf file I ran

sudo su

cd /etc

ls

ls returned the below:

  • image belowenter image description here
0004
  • 1,156
  • 1
  • 14
  • 49
  • 1
    1) `psql` is the client program not the Postgres server 2) What distro and version? 3) How did you install Postgres? 4) Can you connect to the server via `psql`? **Add answers as update to your question** FYI, Postgres 9.2 is 4+ yrs past EOL. – Adrian Klaver Mar 29 '22 at 20:51
  • I just added more detail – 0004 Mar 30 '22 at 02:18
  • @AdrianKlaver what that enough detail? (I cant connect to the server via psql/well I dont know how to test that?) – 0004 Mar 30 '22 at 13:42
  • 1) You show installing Postgres 10 not 11. 2) Amazon Linux AMI is past [EOL](https://aws.amazon.com/amazon-linux-ami/) and only goes up to Postgres 9.6 from [packages](https://amazonlinux.github.io/al1-support-statements/support_info_by_package.html). 3) [Amazon Linux 2](https://aws.amazon.com/amazon-linux-2/?amazon-linux-whats-new.sort-by=item.additionalFields.postDateTime&amazon-linux-whats-new.sort-order=desc) is the current AWS Amazon image. Though I would suggest something like Ubuntu. At any rate you are working with an out of date/not really supported image. – Adrian Klaver Mar 30 '22 at 14:28

0 Answers0