Skip to content

Install Percona Distribiution for PostgreSQL from binary tarballs

You can find the binary tarballs on the Percona website. Select the desired version from a version dropdown and All from the Select Platform dropdown.

There are the following tarballs available for both x86_64 and ARM64 architectures:

  • percona-postgresql-12.22-ssl1.1-linux-.tar.gz - for operating systems that run OpenSSL version 1.x
  • percona-postgresql-12.22-ssl3-linux-.tar.gz - for for operating systems that run OpenSSL version 3.x

To check what OpenSSL version you have, run the following command:

$ openssl version

Tarball contents

The tarballs include the following components:

Component Description
percona-postgresql12 The latest version of PostgreSQL server and the following extensions:
- pgaudit
- pgAudit_set_user
- pg_repack
- pg_stat_monitor
- pg_gather
- wal2json
- the set of contrib extensions
percona-haproxy A high-availability solution and load-balancing solution
percona-patroni A high-availability solution for PostgreSQL
percona-pgbackrest A backup and restore tool
percona-pgbadger PostgreSQL log analyzer with fully detailed reports and graphs
percona-pgbouncer Lightweight connection pooler for PostgreSQL
percona-pgpool-II A middleware between PostgreSQL server and client for high availability, connection pooling and load balancing
percona-perl A Perl module required to create the plperl extension - a procedural language handler for PostgreSQL that allows writing functions in the Perl programming language
percona-python3 A Python3 module required to create plpython extension - a procedural language handler for PostgreSQL that allows writing functions in the Python programming language. Python is also required by Patroni
percona-tcl Tcl development libraries required to create the pltcl extension - a loadable procedural language for the PostgreSQL database system that enables the creation of functions and trigger procedures in the Tcl language
percona-etcd A key-value distributed store that stores the state of the PostgreSQL cluster

Preconditions

  1. Uninstall the upstream PostgreSQL package.
  2. Create the user to own the PostgreSQL process. For example, mypguser. Run the following command:

    $ sudo useradd -m mypguser
    

    Set the password for the user:

    $ sudo passwd mypguser
    

Create the user to own the PostgreSQL process. For example, mypguser, Run the following command:

$ sudo useradd mypguser -m 

Set the password for the user:

$ sudo passwd mypguser

Procedure

The steps below install the tarballs for OpenSSL 3.x on x86_64 architecture. Use another tarball if your operating system has OpenSSL version 1.x and / or has the ARM64 architecture.

  1. Create the directory where you will store the binaries. For example, /opt/pgdistro

  2. Grant access to this directory for the mypguser user.

    $ sudo chown mypguser:mypguser /opt/pgdistro/
    
  3. Fetch the binary tarball:

    $ wget https://downloads.percona.com/downloads/postgresql-distribution-12/12.22/binary/tarball/percona-postgresql-12.22-ssl3-linux-x86_64.tar.gz
    
  4. Extract the tarball to the directory for binaries that you created on step 1.

    $ sudo tar -xfv percona-postgresql-12.22-ssl3-linux-x86_64.tar.gz -C /opt/pgdistro/
    
  5. If you extracted the tarball in a directory other than /opt, copy percona-python3, percona-tcl and percona-perl to the /opt directory. This is required for the correct run of libraries that require those modules.

    $ sudo cp <path_to>/percona-perl <path_to>/percona-python3 <path_to>/percona-tcl /opt/
    
  6. Add the location of the binaries to the PATH variable:

    $ export PATH=:/opt/pgdistro/percona-haproxy/sbin/:/opt/pgdistro/percona-patroni/bin/:/opt/pgdistro/percona-pgbackrest/bin/:/opt/pgdistro/percona-pgbadger/:/opt/pgdistro/percona-pgbouncer/bin/:/opt/pgdistro/percona-pgpool-II/bin/:/opt/pgdistro/percona-postgresql12/bin/:/opt/pgdistro/percona-etcd/bin/:/opt/percona-perl/bin/:/opt/percona-tcl/bin/:/opt/percona-python3/bin/:$PATH
    
  7. Create the data directory for PostgreSQL server. For example, /usr/local/pgsql/data.

  8. Grant access to this directory for the mypguser user.

    $ sudo chown mypguser:mypguser /usr/local/pgsql/data
    
  9. Switch to the user that owns the Postgres process. In our example, mypguser:

    $ su - mypguser
    
  10. Initiate the PostgreSQL data directory:

    $ /opt/pgdistro/percona-postgresql12/bin/initdb -D /usr/local/pgsql/data
    
    Sample output
    Success. You can now start the database server using:
    
    /opt/pgdistro/percona-postgresql12/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
    
  11. Start the PostgreSQL server:

    $ /opt/pgdistro/percona-postgresql12/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
    
    Sample output
    waiting for server to start.... done
    server started
    
  12. To use the createuser binary to create a database user, set the LD_LIBRARY_PATH environment variable to the server’s library path.

    export LD_LIBRARY_PATH=/opt/pgdistro/percona-postgresql12/lib:$LD_LIBRARY_PATH
    
  13. Connect to psql

    $ /opt/pgdistro/percona-postgresql12/bin/psql
    
    Sample output
    psql (12.22)
    Type "help" for help.
    
    postgres=#
    

Start the components

After you unpacked the tarball and added the location of the components’ binaries to the $PATH variable, the components are available for use. You can invoke a component by running its command-line tool.

For example, to check HAProxy version, type:

$ haproxy version

Some components require additional setup. Check the Enabling extensions page for details.

Get expert help

If you need assistance, visit the community forum for comprehensive and free database knowledge, or contact our Percona Database Experts for professional support and services.