Skip to content

PostgreSQL backup tool with Point-In-Time-Recovery and restore verification

FEATURE (postgres): Add PostgreSQL 18 support

Rostislav Dugina018b0c62f71
diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml
index 2992e88e..1901df25 100644
--- a/.github/workflows/ci-release.yml
+++ b/.github/workflows/ci-release.yml
@@ -132,11 +132,12 @@ jobs:
TEST_POSTGRES_15_PORT=5003
TEST_POSTGRES_16_PORT=5004
TEST_POSTGRES_17_PORT=5005
+ TEST_POSTGRES_18_PORT=5006
# testing S3
TEST_MINIO_PORT=9000
TEST_MINIO_CONSOLE_PORT=9001
# testing NAS
- TEST_NAS_PORT=5006
+ TEST_NAS_PORT=7006
EOF
- name: Start test containers
diff --git a/README.md b/README.md
index 781f5ebd..c3a02fd1 100644
--- a/README.md
+++ b/README.md
@@ -54,7 +54,7 @@
### 🐘 **PostgreSQL Support**
-- **Multiple versions**: PostgreSQL 13, 14, 15, 16 and 17
+- **Multiple versions**: PostgreSQL 13, 14, 15, 16, 17 and 18
- **SSL support**: Secure connections available
- **Easy restoration**: One-click restore from any backup
@@ -64,12 +64,6 @@
- **Privacy-first**: All your data stays on your infrastructure
- **Open source**: MIT licensed, inspect every line of code
-### πŸ“Š **Monitoring & Insights**
-
-- **Real-time metrics**: Track database health
-- **Historical data**: View trends and patterns over time
-- **Alert system**: Get notified when issues are detected
-
### πŸ“¦ Installation
You have three ways to install Postgresus:
diff --git a/backend/.env.development.example b/backend/.env.development.example
index d0516c38..0cde0113 100644
--- a/backend/.env.development.example
+++ b/backend/.env.development.example
@@ -22,8 +22,9 @@ TEST_POSTGRES_14_PORT=5002
TEST_POSTGRES_15_PORT=5003
TEST_POSTGRES_16_PORT=5004
TEST_POSTGRES_17_PORT=5005
+TEST_POSTGRES_18_PORT=5006
# testing S3
TEST_MINIO_PORT=9000
TEST_MINIO_CONSOLE_PORT=9001
# testing NAS
-TEST_NAS_PORT=5006
\ No newline at end of file
+TEST_NAS_PORT=7006
\ No newline at end of file
diff --git a/backend/docker-compose.yml.example b/backend/docker-compose.yml.example
index 211bb2eb..cda7e829 100644
--- a/backend/docker-compose.yml.example
+++ b/backend/docker-compose.yml.example
@@ -87,6 +87,17 @@ services:
container_name: test-postgres-17
shm_size: 1gb
+ test-postgres-18:
+ image: postgres:18
+ ports:
+ - "${TEST_POSTGRES_18_PORT}:5432"
+ environment:
+ - POSTGRES_DB=testdb
+ - POSTGRES_USER=testuser
+ - POSTGRES_PASSWORD=testpassword
+ container_name: test-postgres-18
+ shm_size: 1gb
+
# Test NAS server (Samba)
test-nas:
image: dperson/samba:latest
diff --git a/backend/internal/config/config.go b/backend/internal/config/config.go
index 53998002..52b110a0 100644
--- a/backend/internal/config/config.go
+++ b/backend/internal/config/config.go
@@ -38,6 +38,7 @@ type EnvVariables struct {
TestPostgres15Port string `env:"TEST_POSTGRES_15_PORT"`
TestPostgres16Port string `env:"TEST_POSTGRES_16_PORT"`
TestPostgres17Port string `env:"TEST_POSTGRES_17_PORT"`
+ TestPostgres18Port string `env:"TEST_POSTGRES_18_PORT"`
TestMinioPort string `env:"TEST_MINIO_PORT"`
TestMinioConsolePort string `env:"TEST_MINIO_CONSOLE_PORT"`
@@ -154,6 +155,10 @@ func loadEnvVariables() {
log.Error("TEST_POSTGRES_17_PORT is empty")
os.Exit(1)
}
+ if env.TestPostgres18Port == "" {
+ log.Error("TEST_POSTGRES_18_PORT is empty")
+ os.Exit(1)
+ }
if env.TestMinioPort == "" {
log.Error("TEST_MINIO_PORT is empty")
diff --git a/backend/internal/features/tests/postgresql_backup_restore_test.go b/backend/internal/features/tests/postgresql_backup_restore_test.go
index 70874779..a80ce78e 100644
--- a/backend/internal/features/tests/postgresql_backup_restore_test.go
+++ b/backend/internal/features/tests/postgresql_backup_restore_test.go
@@ -73,6 +73,7 @@ func Test_BackupAndRestorePostgresql_RestoreIsSuccesful(t *testing.T) {
{"PostgreSQL 15", "15", env.TestPostgres15Port},
{"PostgreSQL 16", "16", env.TestPostgres16Port},
{"PostgreSQL 17", "17", env.TestPostgres17Port},
+ {"PostgreSQL 18", "18", env.TestPostgres18Port},
}
for _, tc := range cases {
diff --git a/backend/internal/util/tools/enums.go b/backend/internal/util/tools/enums.go
index 0f5fd7ee..c7cdf66c 100644
--- a/backend/internal/util/tools/enums.go
+++ b/backend/internal/util/tools/enums.go
@@ -20,6 +20,7 @@ const (
PostgresqlVersion15 PostgresqlVersion = "15"
PostgresqlVersion16 PostgresqlVersion = "16"
PostgresqlVersion17 PostgresqlVersion = "17"
+ PostgresqlVersion18 PostgresqlVersion = "18"
)
type PostgresqlExecutable string
@@ -41,6 +42,8 @@ func GetPostgresqlVersionEnum(version string) PostgresqlVersion {
return PostgresqlVersion16
case "17":
return PostgresqlVersion17
+ case "18":
+ return PostgresqlVersion18
default:
panic(fmt.Sprintf("invalid postgresql version: %s", version))
}
diff --git a/backend/internal/util/tools/postgresql.go b/backend/internal/util/tools/postgresql.go
index 115aad46..80c6c660 100644
--- a/backend/internal/util/tools/postgresql.go
+++ b/backend/internal/util/tools/postgresql.go
@@ -46,6 +46,7 @@ func VerifyPostgresesInstallation(
PostgresqlVersion15,
PostgresqlVersion16,
PostgresqlVersion17,
+ PostgresqlVersion18,
}
requiredCommands := []PostgresqlExecutable{
diff --git a/backend/tools/download_linux.sh b/backend/tools/download_linux.sh
index d7bc20e9..c1eb263a 100644
--- a/backend/tools/download_linux.sh
+++ b/backend/tools/download_linux.sh
@@ -5,7 +5,7 @@ set -e # Exit on any error
# Ensure non-interactive mode for apt
export DEBIAN_FRONTEND=noninteractive
-echo "Installing PostgreSQL client tools versions 13-17 for Linux (Debian/Ubuntu)..."
+echo "Installing PostgreSQL client tools versions 13-18 for Linux (Debian/Ubuntu)..."
echo
# Check if running on supported system
@@ -47,7 +47,7 @@ echo "Updating package list..."
$SUDO apt-get update -qq -y
# Install client tools for each version
-versions="13 14 15 16 17"
+versions="13 14 15 16 17 18"
for version in $versions; do
echo "Installing PostgreSQL $version client tools..."
diff --git a/backend/tools/download_macos.sh b/backend/tools/download_macos.sh
index 248af811..13937b13 100644
--- a/backend/tools/download_macos.sh
+++ b/backend/tools/download_macos.sh
@@ -2,7 +2,7 @@
set -e # Exit on any error
-echo "Installing PostgreSQL client tools versions 13-17 for MacOS..."
+echo "Installing PostgreSQL client tools versions 13-18 for MacOS..."
echo
# Check if Homebrew is installed
@@ -36,6 +36,7 @@ declare -A PG_URLS=(
["15"]="https://ftp.postgresql.org/pub/source/v15.8/postgresql-15.8.tar.gz"
["16"]="https://ftp.postgresql.org/pub/source/v16.4/postgresql-16.4.tar.gz"
["17"]="https://ftp.postgresql.org/pub/source/v17.0/postgresql-17.0.tar.gz"
+ ["18"]="https://ftp.postgresql.org/pub/source/v18.0/postgresql-18.0.tar.gz"
)
# Create temporary build directory
@@ -106,7 +107,7 @@ build_postgresql_client() {
}
# Build each version
-versions="13 14 15 16 17"
+versions="13 14 15 16 17 18"
for version in $versions; do
url=${PG_URLS[$version]}
diff --git a/backend/tools/download_windows.bat b/backend/tools/download_windows.bat
index 49bee42a..acb98257 100644
--- a/backend/tools/download_windows.bat
+++ b/backend/tools/download_windows.bat
@@ -1,7 +1,7 @@
@echo off
setlocal enabledelayedexpansion
-echo Downloading and installing PostgreSQL versions 13-17 for Windows...
+echo Downloading and installing PostgreSQL versions 13-18 for Windows...
echo.
:: Create downloads and postgresql directories if they don't exist
@@ -22,9 +22,10 @@ set "PG14_URL=%BASE_URL%/postgresql-14.13-1-windows-x64.exe"
set "PG15_URL=%BASE_URL%/postgresql-15.8-1-windows-x64.exe"
set "PG16_URL=%BASE_URL%/postgresql-16.4-1-windows-x64.exe"
set "PG17_URL=%BASE_URL%/postgresql-17.0-1-windows-x64.exe"
+set "PG18_URL=%BASE_URL%/postgresql-18.0-1-windows-x64.exe"
:: Array of versions
-set "versions=13 14 15 16 17"
+set "versions=13 14 15 16 17 18"
:: Download and install each version
for %%v in (%versions%) do (
diff --git a/backend/tools/readme.md b/backend/tools/readme.md
index f97f92e1..94ab9789 100644
--- a/backend/tools/readme.md
+++ b/backend/tools/readme.md
@@ -1,6 +1,6 @@
This directory is needed only for development and CI\CD.
-We have to download and install all the PostgreSQL versions from 13 to 17 locally.
+We have to download and install all the PostgreSQL versions from 13 to 18 locally.
This is needed so we can call pg_dump, pg_dumpall, etc. on each version of the PostgreSQL database.
You do not need to install PostgreSQL fully with all the components.
@@ -13,6 +13,7 @@ We have to install the following:
- PostgreSQL 15
- PostgreSQL 16
- PostgreSQL 17
+- PostgreSQL 18
## Installation
@@ -76,6 +77,7 @@ For example:
- `./tools/postgresql/postgresql-15/bin/pg_dump`
- `./tools/postgresql/postgresql-16/bin/pg_dump`
- `./tools/postgresql/postgresql-17/bin/pg_dump`
+- `./tools/postgresql/postgresql-18/bin/pg_dump`
## Usage
diff --git a/contribute/README.md b/contribute/README.md
index 382dbf5b..a23f7beb 100644
--- a/contribute/README.md
+++ b/contribute/README.md
@@ -72,7 +72,6 @@ If you need to add some explanation, do it in appropriate place in the code. Or
Before taking anything more than a couple of lines of code, please write Rostislav via Telegram (@rostislav_dugin) and confirm priority. It is possible that we already have something in the works, it is not needed or it's not project priority.
Nearsest features:
-- add copying of databases
- add API keys and API actions
Backups flow:
diff --git a/frontend/src/entity/databases/model/postgresql/PostgresqlVersion.ts b/frontend/src/entity/databases/model/postgresql/PostgresqlVersion.ts
index a2daa402..5331a98f 100644
--- a/frontend/src/entity/databases/model/postgresql/PostgresqlVersion.ts
+++ b/frontend/src/entity/databases/model/postgresql/PostgresqlVersion.ts
@@ -4,4 +4,5 @@ export enum PostgresqlVersion {
PostgresqlVersion15 = '15',
PostgresqlVersion16 = '16',
PostgresqlVersion17 = '17',
+ PostgresqlVersion18 = '18',
}
diff --git a/frontend/src/features/databases/ui/edit/EditDatabaseSpecificDataComponent.tsx b/frontend/src/features/databases/ui/edit/EditDatabaseSpecificDataComponent.tsx
index 40fde254..8ed9af96 100644
--- a/frontend/src/features/databases/ui/edit/EditDatabaseSpecificDataComponent.tsx
+++ b/frontend/src/features/databases/ui/edit/EditDatabaseSpecificDataComponent.tsx
@@ -155,6 +155,7 @@ export const EditDatabaseSpecificDataComponent = ({
{ label: '15', value: PostgresqlVersion.PostgresqlVersion15 },
{ label: '16', value: PostgresqlVersion.PostgresqlVersion16 },
{ label: '17', value: PostgresqlVersion.PostgresqlVersion17 },
+ { label: '18', value: PostgresqlVersion.PostgresqlVersion18 },
]}
/>
diff --git a/frontend/src/features/databases/ui/show/ShowDatabaseSpecificDataComponent.tsx b/frontend/src/features/databases/ui/show/ShowDatabaseSpecificDataComponent.tsx
index bc036c19..6644fafb 100644
--- a/frontend/src/features/databases/ui/show/ShowDatabaseSpecificDataComponent.tsx
+++ b/frontend/src/features/databases/ui/show/ShowDatabaseSpecificDataComponent.tsx
@@ -14,6 +14,7 @@ const postgresqlVersionLabels = {
[PostgresqlVersion.PostgresqlVersion15]: '15',
[PostgresqlVersion.PostgresqlVersion16]: '16',
[PostgresqlVersion.PostgresqlVersion17]: '17',
+ [PostgresqlVersion.PostgresqlVersion18]: '18',
};
export const ShowDatabaseSpecificDataComponent = ({ database }: Props) => {