Skip to content

Uninstalling Percona Distribution for PostgreSQL

To uninstall Percona Distribution for PostgreSQL, remove all the installed packages and data / configuration files.

NOTE: Should you need the data files later, back up your data before uninstalling Percona Distribution for PostgreSQL.

Run all commands as root or via sudo.

  1. Stop the Percona Distribution for PostgreSQL service.

    $ sudo systemctl stop postgresql.service
    
  2. Remove the percona-postgresql packages.

    $ sudo apt remove percona-postgresql-12* percona-patroni percona-pgbackrest percona-pgbadger percona-pgbouncer
    
  3. Remove configuration and data files.

    $ rm -rf /etc/postgresql/12/main
    

Run all commands as root or via sudo.

  1. Stop the Percona Distribution for PostgreSQL service.

    $ sudo systemctl stop postgresql-12
    
  2. Remove the percona-postgresql packages

    $ sudo yum remove percona-postgresql12* percona-pgbadger
    
  3. Remove configuration and data files

    $ rm -rf /var/lib/pgsql/12/data
    

Uninstall from tarballs

If you installed Percona Distribution for PostgreSQL from binary tarballs, stop the PostgreSQL server and remove the folder with the binary tarballs.

  1. Stop the postgres server:

    $ /path/to/tarballs/percona-postgresql12/bin/pg_ctl -D path/to/datadir -l logfile stop
    
    Sample output
    waiting for server to shut down.... done
    server stopped
    
  2. Remove the directory with extracted tarballs

    $ sudo rm -rf /path/to/tarballs/
    

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.