Rate This Document
Findability
Accuracy
Completeness
Readability

Uninstalling PostgreSQL

Select an uninstallation mode based on the installation mode. To prevent data loss, back up the database data before uninstalling the database.

Uninstalling the Database (Against RPM Package Installation)

  1. Stop the database process as the postgres user.
    1
    2
    su - postgres
    /home/postgresql-11.3-1/bin/pg_ctl -D /data/pgsql -l logfile stop
    
  2. Uninstall the database RPM package as user root.
    1
    rpm -e postgresql-11.3-1.el7.aarch64
    

Uninstalling the Database (Against Source Code Compilation)

If PostgreSQL is installed by compilation, only corresponding files are generated. Therefore, uninstallation is not involved.

  1. Stop the database process as the postgres user.
    1
    /usr/local/pgsql/bin/pg_ctl -D /data/pgsql -l logfile stop
    
  2. Delete the software installation directory of the database as user root.
    1
    rm -rf /usr/local/pgsql/