mirror of
https://github.com/databasus/databasus.git
synced 2026-04-06 00:32:03 +02:00
FEATURE (postgres): Add PostgreSQL 18 support
This commit is contained in:
3
.github/workflows/ci-release.yml
vendored
3
.github/workflows/ci-release.yml
vendored
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
TEST_NAS_PORT=7006
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ func VerifyPostgresesInstallation(
|
||||
PostgresqlVersion15,
|
||||
PostgresqlVersion16,
|
||||
PostgresqlVersion17,
|
||||
PostgresqlVersion18,
|
||||
}
|
||||
|
||||
requiredCommands := []PostgresqlExecutable{
|
||||
|
||||
@@ -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..."
|
||||
|
||||
@@ -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]}
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -4,4 +4,5 @@ export enum PostgresqlVersion {
|
||||
PostgresqlVersion15 = '15',
|
||||
PostgresqlVersion16 = '16',
|
||||
PostgresqlVersion17 = '17',
|
||||
PostgresqlVersion18 = '18',
|
||||
}
|
||||
|
||||
@@ -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 },
|
||||
]}
|
||||
/>
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ const postgresqlVersionLabels = {
|
||||
[PostgresqlVersion.PostgresqlVersion15]: '15',
|
||||
[PostgresqlVersion.PostgresqlVersion16]: '16',
|
||||
[PostgresqlVersion.PostgresqlVersion17]: '17',
|
||||
[PostgresqlVersion.PostgresqlVersion18]: '18',
|
||||
};
|
||||
|
||||
export const ShowDatabaseSpecificDataComponent = ({ database }: Props) => {
|
||||
|
||||
Reference in New Issue
Block a user