How to Uninstall/Reinstall PostgreSQL 8.4 (Windows)

PokerTracker 3 version 3.10
October 25, 2013
  • Before You Begin

    If PostgreSQL was previously installed on this computer then it is imperative for you to know which major version was installed – 8.3.x or 8.4.x. You can determine this via several methods:

    1. If PostgreSQL is still installed on your computer, go Start -> Programs and look for PostgreSQL (version) where (version) is the major version of PostgreSQL installed on your computer.
    2. If PostgreSQL is no longer installed on your computer, open My Computer and browse to your Program Files/PostgreSQL directory. There will be a sub-directory listed which is either 8.3 or 8.4 depending on the version installed.
     
    This guide is for users who are upgrading from PostgreSQL 8.4 only. If you have PostgreSQL 8.4 installed on your computer then please go to the guide for version 8.3. PostgreSQL 8.3 can only upgrade to 8.3.x and PostgreSQL 8.4 can only upgrade to 8.4.x.
  • Overview

    A proper installation of PostgreSQL can be the difference between a database that runs properly or constantly has problems. All PostgreSQL issues can be classified into two categories:

    1. Service Issues
    2. Database Issues
     
    Properly uninstalling and then reinstalling PostgreSQL will resolve all service issues and some database issues. It will not resolve a corrupted database or database files. Sometimes a corrupted database can be recovered. It is easiest for you to simply create a new PokerTracker 3 database and re-import all of your archived hand histories from your PokerTracker 3/Processed directory which will completely rebuild your database.
     
    Steps provided in this document may vary from different versions of Windows. Instructions which are specific to a certain version of Windows will be noted in bold immediately followed by the instructions. It is then noted when instructions return to all versions of Windows.
  • Microsoft Windows Vista & Windows 7 Users

    PostgreSQL requires complete administrative privileges to install and run properly.

    Although not required, we recommend that you disable User Account Control (UAC) which will ensure that you always have proper administrative permissions. Please read the Tutorial: How to Disable 'User Account Control' (UAC) for step-by-step instructions on how to disable "UAC".

    If you opt to not disable User Account Control (UAC) then you can still install PostgreSQL; however, you must right-click -> Run as Administrator whenever launching a PostgreSQL related function.

    If a step in this guide varies depending on whether UAC is enabled or disabled, it will be specified in the instructions.

  • Uninstalling PostgreSQL

    In Windows go Start -> Control Panel.

    Only Windows XP or 2000
    Click "Add or Remove Programs"

     

    Only Windows Vista
    In Classic View click "Programs and Features"
    In Control Panel Home under Programs click “Uninstall a program”

     

    Only Windows 7
    In the Control Panel, under Programs click “Uninstall a program”

     

    All Windows Versions
    Scroll down and select "PostgreSQL 8.4"

     

    Only Windows XP or 2000
    Click "Remove".

     

     

     

    Only Windows Vista or Windows 7
    Click "Uninstall"

     

     

     

    All Windows Versions
    If the program "psqlODBC" is listed, select it and uninstall as well. If it is not listed then skip.

     

    • Deleting the PostgreSQL Service Account

      Windows XP, 2000 or Windows Vista & Windows 7 (with UAC disabled)
      Go Start -> Run, 'cmd' -> OK.
       

       

      Windows Vista & Windows 7 (with UAC enabled)
      Go Start -> All Programs -> Accessories. Locate the “Command Prompt” and right-click -> Run as Administrator.

       

      All Windows Versions
      At the Windows command prompt type:

       

      net user postgres /delete

       

      Then hit <Enter>
       

       

      It should then say "The command completed successfully." If it does not say this then it failed to delete the postgres service account user due to insufficient privileges. Go back to the step for Windows Vista & Windows 7 (with UAC enabled) users and repeat.

    • Deleting the PostgreSQL Directory

      If you wish to preserve your existing database then please skip this step. This step should only be performed if you are going to be installing a new database or want to delete your existing database.

      Open "My Computer" and browse to your C:/Program Files directory. Locate the directory named "PostgreSQL" and right-click -> Delete.

      PostgreSQL is now completely uninstalled from your computer and you can now proceed to re-install.

  • Manually Installing PostgreSQL
    • Download the Installer from PostgreSQL.org

      When installing PostgreSQL for PokerTracker 3, always download and install the latest version of PostgreSQL 8.4. (At the time of writing this guide, the latest version is 8.4.8-1)

      Open your favorite web browser and go to the PostgreSQL download website at http://www.enterprisedb.org/products-services-training/pgdownload#windows.

      Under the Installer Version 8.4.x click the "Windows" button to begin the download. 

       

    • The PostgreSQL Setup Wizard

      Double-click the downloaded postgresql-8.4.x-windows.exe file that was downloaded to your computer to begin the installer then click the Next button to proceed.

       

      • Installation Directory

        The second screen named Installation Options is the step where you can choose the location to install PostgreSQL. If you need to install PostgreSQL to a non-default location, such as a different hard drive, then click folder icon and browse to and select the location to install.

        We recommend that you install to the default location unless if it is not possible. Simply click Next > to continue.

      • Data Directory

        If this is a new PostgreSQL installation, you will be prompted to select the data directory. Click Next > to continue (DO NOT change this directory location. It will be a sub-directory of the installation directory that you selected in the previous step).

      • Password

        The next screen named Password is for you to create a PostgreSQL database password.

        Enter the default password 'dbpass' twice.

         

         

      • Port

        The next screen named allows you to change Port that PostgreSQL will use. Do not change this value unless if you are an advanced user and know exactly what you are doing. Click Next > to continue.

      • Advanced Options

        Leave the default options selected then click Next > to continue.

      • Ready to Install

        PostgreSQL is now ready to be installed. Click Next > to begin the installation process.

      • Completing the PostgreSQL Setup Wizard

        Once PostgreSQL is finished installing the final screen will prompt you to launch the stack builder upon exit. Uncheck this option then click Finish.

         

         

        PostgreSQL 8.4 should now be successfully installed on your computer.

    • Confirming PostgreSQL Is Running

      To confirm whether or not PostgreSQL is running hit "CTRL-ALT-DELETE" to open the Task Manager.

      Only Windows Vista & Windows 7 (with UAC enabled)
      Click the Show processes from all users button.

       

       

      All Windows Versions

      Under the Processes tab, at the very bottom, make sure that Show processes from all users is checked.

      Click Image Name to sort the list of running processes alphabetically. Scroll down the list and make sure that you see several processes named postgres.exe. If you see this then PostgreSQL is installed properly and you can proceed to run PokerTracker 3.

       

       

      If you do not see PostgreSQL in the list and installation completed without any errors then:

      Windows XP, 2000 or Windows Vista & Windows 7 (with UAC disabled)
      Go Start -> Programs -> PostgreSQL 8.3 -> Start Service.

      Windows Vista & Windows 7 (with UAC enabled)
      Go Start -> Programs -> PostgreSQL 8.3 and right-click ‘Start Service’ and ‘Run as Administrator’.

       

      All Windows Versions
      PostgreSQL should now start and be listed in your Windows Task Manager. If it is not, then please contact PokerTracker support for assistance.

highfalutin