search cancel

How to uninstall Postgresql as either a root or non-root user


Article ID: 20323


Updated On:


CA Application Performance Management Agent (APM / Wily / Introscope) INTROSCOPE


We have installed Postgresql as a non-root user. Now we wish to uninstall. The CA APM Installation and Upgrade Guide says to run the command "uninstall-postgresql", but the file is not found on our system.



Component: APMISP


If you originally installed Postgresql as a root user, the file "uninstall-postgresql" will exist under the home directory of Postgresql, and can be used to perform the uninstall.

If you installed Postgresql as a non-root user this file will not exist.

To uninstall Postgresql originally installed by a non-root user:

Execute the following commands one by one from the console:

Step 1:

     <non_root_user_directory_absolute_path>/opt/database/bin/pg_ctl -D     
     <non_root_user_directory_absolute_path>/opt/database/data stop 

Step 2:

Change directory to:


and execute the following command:

     rm -rf bin doc installer pgAdmin3 scripts stackbuilder include lib postgresql-8.4.5 share

This will perform un-installation using the same approach as "uninstall-postgres".