Skip to content

Commit 2ecdb38

Browse files
FEATURE (postgres): Add PostgreSQL 18 support
1 parent 97d7253 commit 2ecdb38

File tree

15 files changed

+38
-16
lines changed

15 files changed

+38
-16
lines changed

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
### 🐘 **PostgreSQL Support**
5656

57-
- **Multiple versions**: PostgreSQL 13, 14, 15, 16 and 17
57+
- **Multiple versions**: PostgreSQL 13, 14, 15, 16, 17 and 18
5858
- **SSL support**: Secure connections available
5959
- **Easy restoration**: One-click restore from any backup
6060

@@ -64,12 +64,6 @@
6464
- **Privacy-first**: All your data stays on your infrastructure
6565
- **Open source**: MIT licensed, inspect every line of code
6666

67-
### 📊 **Monitoring & Insights**
68-
69-
- **Real-time metrics**: Track database health
70-
- **Historical data**: View trends and patterns over time
71-
- **Alert system**: Get notified when issues are detected
72-
7367
### 📦 Installation
7468

7569
You have three ways to install Postgresus:

backend/.env.development.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ TEST_POSTGRES_14_PORT=5002
2222
TEST_POSTGRES_15_PORT=5003
2323
TEST_POSTGRES_16_PORT=5004
2424
TEST_POSTGRES_17_PORT=5005
25+
TEST_POSTGRES_18_PORT=5006
2526
# testing S3
2627
TEST_MINIO_PORT=9000
2728
TEST_MINIO_CONSOLE_PORT=9001
2829
# testing NAS
29-
TEST_NAS_PORT=5006
30+
TEST_NAS_PORT=7006

backend/docker-compose.yml.example

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,17 @@ services:
8787
container_name: test-postgres-17
8888
shm_size: 1gb
8989

90+
test-postgres-18:
91+
image: postgres:18
92+
ports:
93+
- "${TEST_POSTGRES_18_PORT}:5432"
94+
environment:
95+
- POSTGRES_DB=testdb
96+
- POSTGRES_USER=testuser
97+
- POSTGRES_PASSWORD=testpassword
98+
container_name: test-postgres-18
99+
shm_size: 1gb
100+
90101
# Test NAS server (Samba)
91102
test-nas:
92103
image: dperson/samba:latest

backend/internal/config/config.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ type EnvVariables struct {
3838
TestPostgres15Port string `env:"TEST_POSTGRES_15_PORT"`
3939
TestPostgres16Port string `env:"TEST_POSTGRES_16_PORT"`
4040
TestPostgres17Port string `env:"TEST_POSTGRES_17_PORT"`
41+
TestPostgres18Port string `env:"TEST_POSTGRES_18_PORT"`
4142

4243
TestMinioPort string `env:"TEST_MINIO_PORT"`
4344
TestMinioConsolePort string `env:"TEST_MINIO_CONSOLE_PORT"`
@@ -154,6 +155,10 @@ func loadEnvVariables() {
154155
log.Error("TEST_POSTGRES_17_PORT is empty")
155156
os.Exit(1)
156157
}
158+
if env.TestPostgres18Port == "" {
159+
log.Error("TEST_POSTGRES_18_PORT is empty")
160+
os.Exit(1)
161+
}
157162

158163
if env.TestMinioPort == "" {
159164
log.Error("TEST_MINIO_PORT is empty")

backend/internal/features/tests/postgresql_backup_restore_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ func Test_BackupAndRestorePostgresql_RestoreIsSuccesful(t *testing.T) {
7373
{"PostgreSQL 15", "15", env.TestPostgres15Port},
7474
{"PostgreSQL 16", "16", env.TestPostgres16Port},
7575
{"PostgreSQL 17", "17", env.TestPostgres17Port},
76+
{"PostgreSQL 18", "18", env.TestPostgres18Port},
7677
}
7778

7879
for _, tc := range cases {

backend/internal/util/tools/enums.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const (
2020
PostgresqlVersion15 PostgresqlVersion = "15"
2121
PostgresqlVersion16 PostgresqlVersion = "16"
2222
PostgresqlVersion17 PostgresqlVersion = "17"
23+
PostgresqlVersion18 PostgresqlVersion = "18"
2324
)
2425

2526
type PostgresqlExecutable string
@@ -41,6 +42,8 @@ func GetPostgresqlVersionEnum(version string) PostgresqlVersion {
4142
return PostgresqlVersion16
4243
case "17":
4344
return PostgresqlVersion17
45+
case "18":
46+
return PostgresqlVersion18
4447
default:
4548
panic(fmt.Sprintf("invalid postgresql version: %s", version))
4649
}

backend/internal/util/tools/postgresql.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ func VerifyPostgresesInstallation(
4646
PostgresqlVersion15,
4747
PostgresqlVersion16,
4848
PostgresqlVersion17,
49+
PostgresqlVersion18,
4950
}
5051

5152
requiredCommands := []PostgresqlExecutable{

backend/tools/download_linux.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -e # Exit on any error
55
# Ensure non-interactive mode for apt
66
export DEBIAN_FRONTEND=noninteractive
77

8-
echo "Installing PostgreSQL client tools versions 13-17 for Linux (Debian/Ubuntu)..."
8+
echo "Installing PostgreSQL client tools versions 13-18 for Linux (Debian/Ubuntu)..."
99
echo
1010

1111
# Check if running on supported system
@@ -47,7 +47,7 @@ echo "Updating package list..."
4747
$SUDO apt-get update -qq -y
4848

4949
# Install client tools for each version
50-
versions="13 14 15 16 17"
50+
versions="13 14 15 16 17 18"
5151

5252
for version in $versions; do
5353
echo "Installing PostgreSQL $version client tools..."

backend/tools/download_macos.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e # Exit on any error
44

5-
echo "Installing PostgreSQL client tools versions 13-17 for MacOS..."
5+
echo "Installing PostgreSQL client tools versions 13-18 for MacOS..."
66
echo
77

88
# Check if Homebrew is installed
@@ -36,6 +36,7 @@ declare -A PG_URLS=(
3636
["15"]="https://ftp.postgresql.org/pub/source/v15.8/postgresql-15.8.tar.gz"
3737
["16"]="https://ftp.postgresql.org/pub/source/v16.4/postgresql-16.4.tar.gz"
3838
["17"]="https://ftp.postgresql.org/pub/source/v17.0/postgresql-17.0.tar.gz"
39+
["18"]="https://ftp.postgresql.org/pub/source/v18.0/postgresql-18.0.tar.gz"
3940
)
4041

4142
# Create temporary build directory
@@ -106,7 +107,7 @@ build_postgresql_client() {
106107
}
107108

108109
# Build each version
109-
versions="13 14 15 16 17"
110+
versions="13 14 15 16 17 18"
110111

111112
for version in $versions; do
112113
url=${PG_URLS[$version]}

backend/tools/download_windows.bat

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@echo off
22
setlocal enabledelayedexpansion
33

4-
echo Downloading and installing PostgreSQL versions 13-17 for Windows...
4+
echo Downloading and installing PostgreSQL versions 13-18 for Windows...
55
echo.
66

77
:: 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"
2222
set "PG15_URL=%BASE_URL%/postgresql-15.8-1-windows-x64.exe"
2323
set "PG16_URL=%BASE_URL%/postgresql-16.4-1-windows-x64.exe"
2424
set "PG17_URL=%BASE_URL%/postgresql-17.0-1-windows-x64.exe"
25+
set "PG18_URL=%BASE_URL%/postgresql-18.0-1-windows-x64.exe"
2526

2627
:: Array of versions
27-
set "versions=13 14 15 16 17"
28+
set "versions=13 14 15 16 17 18"
2829

2930
:: Download and install each version
3031
for %%v in (%versions%) do (

0 commit comments

Comments
 (0)