Install PostgreSQL on Windows
To install PostgreSQL on Windows:
- Download and run the Windows PostgreSQL one click installer.
- If given the option, install PostgreSQL as a Windows Service. Recent installers install the Windows Service by default.
- Keep track of the PostgreSQL Windows Service account name and password. LabKey Server doesn't really care what this password is set to, but we need to ask for it so that we can pass it along to the PostgreSQL installer.
- Keep track of the database superuser name and password. You'll need these to initially create the labkey database, the labkey database user, and grant that user the owner role.
- Select the PL/pgsql procedural language for installation if prompted by the installer.
- We recommend that you install the graphical tool pgAdmin (III or 4, as applicable) for easy database administration. Leave the default settings as they are on the "Installation Options" page to include pgAdmin.
- If you have chosen to install pgAdminIII, enable the Adminpack contrib module when prompted by the installer.
- Using superuser permissions:
- Create an empty database.
- Create a PostgreSQL user named 'labkey'.
- Grant the owner role to the labkey user over the database.
- Revoke public permissions from the database.
See the following example PostgreSQL commands:
Connect to the DB server as the Postgres Super User using the psql command:
psql -h <host_Name> -U <Super_username> -d postgres
Issue the following SQL commands to create the user, database and revoke public permissions from the database
create user labkey password 'PASSWORD_HERE' ;
create database "<labkey_db_name>" with owner labkey;
revoke all on database "<labkey_db_name>" from public;
Please read the notes below to forestall any difficulties with the PostgreSQL installation.