How to Uninstall PostgreSQL v18.4 on Windows 11 (2026) | Step-by-Step Guide

Below is a Step-by-Step Guide to Uninstall PostgreSQL v18.4 on Windows 11:

Step 1: Follow Any of the Below Methods

Method 1 - Uninstall PostgreSQL via PostgreSQL Uninstaller

  1. Go to PostgreSQL installed location:
    C:\Program Files\PostgreSQL\18
  2. Double-click on:
    uninstall-postgresql.exe
  3. Click "Yes" if you get a security prompt.
  4. Select "Entire Application" and click "Next".
  5. Once uninstallation is complete, click "OK""OK".

Method 2 - Uninstall PostgreSQL via Windows Settings

  1. Press Windows + I to open Settings.
  2. Go to Apps.
  3. Click Installed apps.
  4. Search for "PostgreSQL" and click:
    ...UninstallUninstall
  5. Click "Yes" if you get a security prompt.
  6. Select "Entire Application" and click "Next".
  7. Once uninstallation is complete, click "OK""OK".

Method 3 - Uninstall PostgreSQL via Control Panel

  1. Press Windows + R.
  2. Type the below command and press Enter:
    appwiz.cpl
  3. Select "PostgreSQL" and click "Uninstall".
  4. Click "Yes" if you get a security prompt.
  5. Select "Entire Application" and click "Next".
  6. Once uninstallation is complete, click "OK""OK".

Step 2: Cleanup

Delete the below leftover files/folders if present:

%APPDATA%\pgadmin4
%APPDATA%\pgAdmin
C:\Program Files\PostgreSQL\
C:\Program Files (x86)\PostgreSQL\

Step 3: Remove PostgreSQL from PATH

  1. Press Win + R, type the below command and press Enter:
    sysdm.cpl
  2. Go to the Advanced tab.
  3. Click Environment Variables.
  4. Under System variables, select Path and click "Edit".
  5. Select the below path and click "Delete":
    C:\Program Files\PostgreSQL\18\bin
  6. Click OK → OK → OK.

Step 4: Verify Uninstallation

  1. Open Command Prompt and run the below command:
    psql --version
  2. You should get the below output confirming successful uninstallation:
    'psql' is not recognized as an internal or external command.

Comments