Skip to content

Commit 6738b08

Browse files
committed
Merge branch '263-logical-copy-multiple-databases' into 'master'
feat: provide tools to logical copy multiple or all databases (#263) Closes #263 See merge request postgres-ai/database-lab!292
2 parents 7721827 + ec62d1d commit 6738b08

File tree

9 files changed

+483
-114
lines changed

9 files changed

+483
-114
lines changed

configs/config.example.logical_generic.yml

+31-14
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,19 @@ retrieval:
172172
# The environment variable has a higher priority.
173173
password: postgres
174174

175-
# Options for a partial dump.
176-
# partial:
177-
# tables:
178-
# - test
175+
# Option for specifying the database list that must be copied.
176+
# By default, DLE dumps and restores all available databases.
177+
# Do not specify the databases section to take all databases.
178+
# databases:
179+
# database1:
180+
# # Option for a partial dump. Do not specify the tables section to dump all available tables.
181+
# tables:
182+
# - test
183+
# database2:
184+
# databaseN:
179185

180186
# Use parallel jobs to dump faster.
181-
# It's ignored if "restore" is present because "pg_dump | pg_restore" is always single-threaded.
187+
# Its ignored if “immediateRestore.enabled: true” is present because pg_dump | pg_restore is always single-threaded.
182188
parallelJobs: 2
183189

184190
# Options for direct restore to Database Lab Engine instance.
@@ -187,19 +193,20 @@ retrieval:
187193
# this option does not support parallelization, it is always a single-threaded (both for
188194
# dumping on the source, and restoring on the destination end).
189195
# immediateRestore:
196+
# # Enable immediate restore.
197+
# enabled: true
190198
# # Restore data even if the Postgres directory (`global.dataDir`) is not empty.
191199
# # Note the existing data might be overwritten.
192200
# forceInit: false
193-
#
201+
# # Option to adjust PostgreSQL configuration for a logical dump job.
202+
# # It's useful if a dumped database contains non-standard extensions.
194203
# configs:
195204
# shared_preload_libraries: "pg_stat_statements"
196205

197206
# Restores PostgreSQL database from the provided dump. If you use this block, do not use
198207
# "restore" option in the "logicalDump" job.
199208
logicalRestore:
200209
options:
201-
dbname: "test"
202-
203210
# The location of the archive file (or directory, for a directory-format archive) to be restored.
204211
dumpLocation: "/var/lib/dblab/dblab_pool/dump/db.dump"
205212

@@ -214,15 +221,25 @@ retrieval:
214221
# Note the existing data might be overwritten.
215222
forceInit: false
216223

217-
# Options for a partial dump.
218-
# partial:
219-
# tables:
220-
# - test
221-
222-
#
224+
# Option to adjust PostgreSQL configuration for a logical restore job
225+
# It's useful if a restored database contains non-standard extensions.
223226
# configs:
224227
# shared_preload_libraries: "pg_stat_statements"
225228

229+
# Option for specifying the database list that must be restored.
230+
# By default, DLE restores all available databases.
231+
# Do not specify the databases section to restore all available databases.
232+
# databases:
233+
# database1:
234+
# # Dump format. Available formats: directory, custom, plain. Default format: directory.
235+
# format: directory
236+
# # Option for a partial restore. Do not specify the tables section to restore all available tables.
237+
# tables:
238+
# - table1
239+
# - table2
240+
# database2:
241+
# databaseN:
242+
226243
logicalSnapshot:
227244
options:
228245
# Define pre-precessing SQL queries for data patching. For example, "/tmp/scripts/sql".

configs/config.example.logical_rds_iam.yml

+31-14
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,20 @@ retrieval:
173173
# Path to the SSL root certificate: https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem
174174
sslRootCert: "/cert/rds-combined-ca-bundle.pem"
175175

176-
# Options for a partial dump.
177-
# partial:
178-
# tables:
179-
# - test
176+
# Option for specifying the database list that must be copied.
177+
# By default, DLE dumps and restores all available databases.
178+
# Do not specify the databases section to take all databases.
179+
# databases:
180+
# database1:
181+
# # Option for a partial dump. Do not specify the tables section to dump all available tables.
182+
# tables:
183+
# - table1
184+
# - table2
185+
# database2:
186+
# databaseN:
180187

181188
# Use parallel jobs to dump faster.
182-
# It's ignored if "restore" is present because "pg_dump | pg_restore" is always single-threaded.
189+
# Its ignored if “immediateRestore.enabled: true” is present because pg_dump | pg_restore is always single-threaded.
183190
parallelJobs: 2
184191

185192
# Options for direct restore to Database Lab Engine instance.
@@ -188,19 +195,20 @@ retrieval:
188195
# this option does not support parallelization, it is always a single-threaded (both for
189196
# dumping on the source, and restoring on the destination end).
190197
# immediateRestore:
198+
# # Enable immediate restore.
199+
# enabled: true
191200
# # Restore data even if the Postgres directory (`global.dataDir`) is not empty.
192201
# # Note the existing data might be overwritten.
193202
# forceInit: false
194-
#
203+
# # Option to adjust PostgreSQL configuration for a logical dump job.
204+
# # It's useful if a dumped database contains non-standard extensions.
195205
# configs:
196206
# shared_preload_libraries: "pg_stat_statements"
197207

198208
# Restores PostgreSQL database from the provided dump. If you use this block, do not use
199209
# "restore" option in the "logicalDump" job.
200210
logicalRestore:
201211
options:
202-
dbname: "test"
203-
204212
# The location of the archive file (or directory, for a directory-format archive) to be restored.
205213
dumpLocation: "/var/lib/dblab/dblab_pool/dump/rds_db.dump"
206214

@@ -214,15 +222,24 @@ retrieval:
214222
# Note the existing data might be overwritten.
215223
forceInit: false
216224

217-
# Options for a partial dump.
218-
# partial:
219-
# tables:
220-
# - test
221-
222-
#
225+
# Option to adjust PostgreSQL configuration for a logical restore job
226+
# It's useful if a restored database contains non-standard extensions.
223227
# configs:
224228
# shared_preload_libraries: "pg_stat_statements"
225229

230+
# Option for specifying the database list that must be restored.
231+
# By default, DLE restores all available databases.
232+
# Do not specify the databases section to restore all available databases.
233+
# databases:
234+
# database1:
235+
# # Dump format. Available formats: directory, custom, plain. Default format: directory.
236+
# format: directory
237+
# # Option for a partial restore. Do not specify the tables section to restore all available tables.
238+
# tables:
239+
# - test
240+
# database2:
241+
# databaseN:
242+
226243
logicalSnapshot:
227244
options:
228245
# Define pre-precessing SQL queries for data patching. For example, "/tmp/scripts/sql".

0 commit comments

Comments
 (0)