Skip to end of metadata
Go to start of metadata

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.

docker-compose.yml
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.


  • No labels