How to Uninstall/Reinstall PostgreSQL 8.3 (Windows)

PokerTracker 4 version 4.0.x
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, for example PostgreSQL 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.3 only. If you have PostgreSQL 8.4 installed on your computer then please go to the guide for version 8.4. 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 4 database and re-import all of your archived hand histories from your PokerTracker 4/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.3"
     
    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 4, always download and install the latest version of PostgreSQL 8.3. (At the time of writing this guide, the latest version is 8.3.15)

      Open your favorite web browser and go to the PostgreSQL website, http://www.postgresql.org.

      At the top of the page click "Downloads".

      On the "Downloads" page under "Binary packages" click "Windows".

       

      Under pgInstaller click the Download link. (DO NOT use the One Click Installer)

       

       

      Scroll down the page and double click the latest version of PostgreSQL 8.3 which at the point of writing this guide is 8.3.15.

       

       

      Then click "win32".

       

       

      Then click the postgresql-8.3.x.zip link.

       

       

      Scroll down the page and click either "http" or "ftp" below your country's flag (this simply chooses the download location closest to you for faster download speeds).

      Save the file to your computer (we recommend saving the downloaded file to your Desktop for ease of access).
    • Extracting the Downloaded PostgreSQL Installer

      The file that you downloaded is a compressed zip file which contains all of the files necessary to install PostgreSQL. You cannot run the PostgreSQL installer from this compressed zip file, you must extract the contents of the zip file in order to install.

      Double click the file that you downloaded to preview the contents of the zip file. (If you have a third party zip utility on your computer you can extract the files using this). If not, you will need to extract the files from the zip utility built directly into Windows.

       

      Windows XP or 2000
      Click "Extract all files" on the left side of the window.

       

       

      The Extraction Wizard will open. Proceed through extracting the files by clicking Next then eventually Finish.

       

      Windows Vista or Windows 7
      Click Extract all files on the top ribbon.

       

       

      The Extract Compressed (Zipped) Folders wizard will open. Make sure that Show extracted fields when complete is checked then click the Extract button.

       

       

      All Windows Versions
      A new window will open displaying the directory where the extracted files are located.

    • The PostgreSQL Installer

      Double click the postgresql-8.3.msi file to launch the PostgreSQL installer.

       

       

      The first step is to choose the language to install PostgreSQL. Select English (even if it is not your primary language) then click Start.
       
      Continue to click Next through the next two screens.
       

       

      • Installation Directory

        The third 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 Browse and then 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.

      • Service Configuration

        The next screen named Service Configuration will install the service that runs the PostgreSQL database. There are two separate PostgreSQL username/password combinations. The service account user (this step) and the database user (next step).

        Do not change any of these options. Simply create your password and enter it into the Account Password box then re-enter your password in the Verify Password box then click Next.

        (PokerTracker 4 uses a default password of "svcPASS83" (no quotes) which is what we recommend. This password is not very important and you will probably never need it again.)

         

         

        You will then be prompted that the user was not found and whether or not you want the account to be created for you. Click Yes.

         

         

        You will then be prompted that the password you created appears to be weak and asking whether you want the installer to replace the password you created with a random password. Click No.

         

      • Initialize Database Cluster

        This step is very important and your action depends on whether you are preserving an existing database or creating a new database.

        If you are reinstalling PostgreSQL with an existing database (you did not delete your PostgreSQL directory during uninstall) then you must uncheck Initialize database cluster. Your PostgreSQL database user and password will be retained from your previous PostgreSQL installation.

        If you are installing PostgreSQL for the first time or you are not preserving an old database (you deleted your PostgreSQL directory during uninstall) then you must leave Initialize database cluster checked.

        For both the Encoding (Server) and (Client) select SQL_ASCII.

        Enter the default Password 'dbpass' (no quotes). Then enter the 'dbpass' Password (again).

        Leave all other fields as the default value.

         

         

         

        Proceed to click Next through the next three steps leaving all values as their default. PostgreSQL will then proceed with installation onto your computer.

        Note: If during installation it fails to create the postgres service account then one of two problems occurred:

        1. You did not properly delete your previous postgres service account. Go back to the Deleting the PostgreSQL Service Account section in this guide then you can proceed with running the PostgreSQL installer again.
        2. You are not logged into an Administrator's account. PostgreSQL requires that you have administrative privileges to properly install.

        (If you have deleted the PostgreSQL service account and are logged into Windows as an "Administrators" account then please contact PokerTracker support)

         

        PostgreSQL should install properly and which point you will reach the Installation complete window. Uncheck Launch Stack Builder at Exit and then click the Finish button.

    • 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 4.

       

       

      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.