fix: postgres keep_ownership flag

This commit is contained in:
charles-gauthereau
2026-06-29 19:10:49 +02:00
parent ee51996401
commit 34f353b68f
3 changed files with 33 additions and 2 deletions
+12 -2
View File
@@ -8,9 +8,19 @@
"password": "changeme",
"port": 5432,
"host": "db-postgres",
"generated_id": "16678159-ff7e-4c97-8c83-0adeff214681",
"generated_id": "16678159-ff7e-4c97-8c83-0adeff214681"
},
{
"name": "Test database 1 - PostgreSQL - BIS",
"database": "devdb2",
"type": "postgresql",
"username": "devuser2",
"password": "changeme2",
"port": 5432,
"host": "db-postgres-2",
"generated_id": "16678159-ff7e-5697-8c83-0adeff214681",
"options": {
"keep_ownership": false
"keep_ownership": true
}
},
{
+15
View File
@@ -15,6 +15,20 @@ services:
networks:
- portabase
db-postgres-2:
container_name: db-postgres-2
image: postgres:17-alpine
ports:
- "5438:5432"
volumes:
- postgres-data-2:/var/lib/postgresql/data
environment:
- POSTGRES_DB=devdb2
- POSTGRES_USER=devuser2
- POSTGRES_PASSWORD=changeme2
networks:
- portabase
db-mariadb:
container_name: db-mariadb
image: mariadb:latest
@@ -179,6 +193,7 @@ services:
volumes:
postgres-data:
postgres-data-2:
mariadb-data:
mysql-data:
mongodb-data:
+6
View File
@@ -46,6 +46,12 @@ pub async fn run(
.and_then(|v| v.as_bool())
.unwrap_or(false);
if keep_ownership {
logger.log("info", format!("Restoring ownership and privileges for {}", cfg.name));
} else {
logger.log("info", format!("Stripping ownership and privileges for {} (--no-owner --no-privileges)", cfg.name));
}
match format {
PostgresDumpFormat::Fc => {
logger.log("info", format!("Running FC restore for {}", cfg.name));