A slightly modified version of the Amazon Linux YUM repository can be used to install the correct (el7) version of postgresql-server and thus, plperl:
[pgdg96]
name=PostgreSQL 9.6 - Amazon Linux 2 - $basearch
baseurl=https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-96
[pgdg96-source]
name=PostgreSQL 9.6 - Amazon Linux 2 - $basearch - Source
failovermethod=priority
baseurl=https://download.postgresql.org/pub/repos/yum/srpms/9.6/redhat/rhel-7-$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-96
[pgdg96-updates-testing]
name=PostgreSQL 9.6 - Amazon Linux 2 - $basearch
baseurl=https://download.postgresql.org/pub/repos/yum/testing/9.6/redhat/rhel-7-$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-96
[pgdg96-source-updates-testing]
name=PostgreSQL 9.6 - Amazon Linux 2 - $basearch - Source
failovermethod=priority
baseurl=https://download.postgresql.org/pub/repos/yum/srpms/testing/9.6/redhat/rhel-7-$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-96
Installed packages:
$ rpm -qa | grep postgresql96
postgresql96-contrib-9.6.12-1PGDG.rhel7.x86_64
postgresql96-plperl-9.6.12-1PGDG.rhel7.x86_64
postgresql96-9.6.12-1PGDG.rhel7.x86_64
postgresql96-server-9.6.12-1PGDG.rhel7.x86_64
postgresql96-libs-9.6.12-1PGDG.rhel7.x86_64
L.E. Now, Postgres 9.6 is available in the amazon-linux-extras packages:
# amazon-linux-extras | grep postgres
5 postgresql9.6 available [ =9.6.6 =9.6.8 ]
6 postgresql10 available [ =10 ]
To enable the repository, you can do a amazon-linux-extras enable postgresql9.6
.