Knowledgebase

Search:     Advanced search

Uninstalling PostgreSQL

Article ID: 680  |  Last updated: 23 Dec, 2014

When you uninstall Surround SCM, PostgreSQL is not removed. Following are instructions for uninstalling PostgreSQL and manually removing database files and the postgres user account and group.

Windows

Use the uninstaller to remove PostgreSQL.

  1. Choose Start > Control Panel > Add or Remove Programs.
  2. Select PostgreSQL.
  3. Click Remove.

The default directory for PostgreSQL data files is C:\Program Files\PostgreSQL\Version#\Data. Manually delete this directory to remove the files. Use Computer Management to remove the PostgreSQL user account.

  1. Choose Start > Control Panel > Administrative Tools > Computer Management.
  2. Expand the Local Groups and Users directory.
  3. Select the Users directory.
  4. Delete the postgres user from the local users list.

Unix

The default directory for PostgreSQL is /usr/local/pgsql. To uninstall PostgreSQL, manually delete the PostgreSQL folder from the default directory. To delete the database files, manually delete the Data folder from the default directory.

You can also use the following command to uninstall PostgreSQL and delete the database directories at the same time:
rm -rf /usr/local/pgsql

To remove the PostgreSQL user account on Linux, use the following command:
userdel postgres

To remove the PostgreSQL user account on Mac OS X, use the following command:
dscl . -delete /Users/postgres

A postgres group is also installed with PostgreSQL on Mac OS X. Use the following command to remove the postgres group:
dscl . -delete /Groups/postgres

Note: You must have the Mac root account enabled to remove the postgres user and group.

Article ID: 680  |   Last updated: 23 Dec, 2014
Tags
PostgreSQL uninstall

Prev   Next
Starting the PostgreSQL Server     Supported WebDAV Actions for Mac OS X