PostgreSQL

Docker

W celu postawienia bazy należy najpierw ściągnąć dockera. I zip'a zawierającego sql, properties i plik .yml postgres.zip. Następnie go wypakować.

Należy wprowadzić jedną zmianę do pliku compose.

version: "3.7"
services:
  postgres:
    image: postgres:13-alpine
    container_name: "postgres"
    restart: always
    ports:
      - "5566:5432"
    volumes:
      - /home/suncode/work/Databases/compose-POSTGRES:/var/lib/postgresql/data #Ustawiamy do którego folderu ma zostać wykonany compose (w zależności od waszych folderów /home/suncode/work/Databases)
      - ./sql/postgres:/docker-entrypoint-initdb.d
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=Testowanie12#$$
#      - POSTGRES_HOST_AUTH_METHOD=md5

Następnie otwieramy folder postgres w terminalu i wpisujemy 'sudo docker compose up'.

Połączenie z bazą możemy przetestować w DBeaver, konfiguracja połączenia znajduję się w folderze postgres/db_properties/posgres.properties.

Instalacja

Należy pobrać aktualną wersję bazy danych PostgreSQL o numerze 9.4 ze strony: https://www.postgresql.org/download/

Podczas instalacji możemy zachować domyślne ustawienia: port 5432, login: postgres, hasło postgres.

Stworzenie bazy danych

Aby stworzyć bazę danych musimy uruchomić program pgAdmin III - powinien zostać zainstalowany wraz z PostgreSQL.

Klikamy dwa razy na nasz serwer, a następnie prawym przyciskiem myszy na pole "Bazy danych"

Z listy wybieramy "Nowa baza danych".

W nowym oknie uzupełniamy pola odpowiadające za nazwę bazy danych i właściciela, po czym zatwierdzamy przyciskiem OK.

PostgreSQL

Docker

In order to put up the database, first download docker. And zip containing sql, properties and .yml file postgres.zip. Then extract it.

One change should be made to the compose file.

version: "3.7"
services:
  postgres:
    image: postgres:13-alpine
    container_name: "postgres"
    restart: always
    ports:
      - "5566:5432"
    volumes:
      - /home/suncode/work/Databases/compose-POSTGRES:/var/lib/postgresql/data #Set to which folder the compose should be performed (depending on your /home/suncode/work/Databases folders)
      - ./sql/postgres:/docker-entrypoint-initdb.d
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=Testowanie12#$$
#      - POSTGRES_HOST_AUTH_METHOD=md5

Next, open the postgres folder in terminal and type 'sudo docker compose up'.

You can test the connection to the database in DBeaver, the connection configuration is in the postgres/db_properties/posgres.properties folder.


Installation

You need to download the current version of the PostgreSQL database with the number 9.4 from the website: https://www.postgresql.org/download/

During the installation you can keep the default settings: port 5432, login: postgres, password postgres.

Creating a database

To create a database, you need to run pgAdmin III - it should have been installed with PostgreSQL.

Double-click on our server, then right-click on the "Databases" box.


Select "New database" from the list.

In the new window, fill in the fields responsible for the database name and owner, and confirm with OK.