This article is about installing PostgreSQL. Setting up a connection with r_keeper 7 is described in a separate article.

Installing PostgreSQL

  1. Download the installer from the website: https://www.postgresql.org/download/windows/.
    At the time of this writing, the latest version of the PostgreSQL database is 13.3. We used a 64-bit platform, therefore, we downloaded the version for Windows x86-64.
  2. Run the .exe file and walk through the basic installation steps.
    Almost all steps already have pre-filled values. They do not need to be changed unless necessary:
    • Specify the installation path.
      The location of the server is of no importance unless there are specific reasons for the change.
    • Specify the database components.
      All the components are selected by default.
    • Choose a path for the stored data.
      The location of the database doesn't matter either.
    • Choose a password for the postgres superuser.
      For example, postgres.
    • Select the port for the installed PostgreSQL server copy.
      By default: 5432.
    • Select the database localization. By default, it is the Default locale.
      In the future, when using Unicode, the localization will not matter for the stored data. But the names depend on the localization, for example, the days of the week and months.
  3. The installer will offer to look at the selected parameters.
  4. Check them and start the installation.
  5. There is no need to run Stack Builder yet. Uncheck the box and click Finish.

Starting pgAdmin

  1. In the PostgreSQL 13 folder, select and run the pgAdmin 4 application
    image2021-6-18_11-57-27.png
  2. A launch window will appear
    image2021-6-18_11-58-10.png
  3. Set a password for the admin panel, for example, postgres.
  4. Click the OK button.
    image2021-6-18_11-59-3.png
    It will connect to the server using the password specified during installation. Then one pre-installed postgres database will appear.
  5. Create your database.

Database creation

  1. Select the standard postgres database and right click on it.
  2. In the context menu, click on the Query Tool item.

    A field for entering the SQL code will open in the central part of the program.
  3. In this field, enter the following code with the name of the new database:

    create database pgs;
  4. Click on the execute code button image2021-6-21_9-59-26.png.

    After that, you will see a message that the pgs database has been created.
  5. To see it, right-click on the Databases node and select Refresh... in the context menu.

    The list will be updated and the created database will appear.
  6. By default, the database is inactive, so its icon is grayed out image2021-6-21_10-12-9.png.
    To connect to it, just click on it and open its node.
  7. Create users to work with the database:
    • Select the created pgs database and right-click on it
    • In the context menu, click on the Query Tool item
    • Enter the following code:

      create user username password 'pgspgs';
      grant all on database pgs to username;
      alter user username with createrole;

      This will create a username user with full access to the pgs database and the right to create roles.

  8. To test the user creation in pgAdmin 4, type the following command in the Query Tool:

    select *
    from pg_shadow

    A list of all users will appear:

  9. When closing pgAdmin 4, save your changes to the existing or new folder
  10. Go to the instructions for setting up r_keeper connection with PostgreSQL database.


  • No labels