Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add schemaOnly to the import section (#2234)
The import feature was previously importing everything, schema and data, with this new feature we will be able to select only schema or schema and data. The way is doing this it's using the `section` feature from `pg_dump` and `pg_restore` commands, we select which section we want to dump/restore, for a full dump and restore we use `pre-data`, `data` and `post-data` sections, while to import only the schema the section `pre-data` and `post-data` is used. Closes #2228 Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com> Signed-off-by: Jonathan Gonzalez V <jonathan.gonzalez@enterprisedb.com> Co-authored-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com> Co-authored-by: Jonathan Gonzalez V <jonathan.gonzalez@enterprisedb.com> (cherry picked from commit ad0fdb2)
- Loading branch information
Showing
5 changed files
with
65 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
docs/src/samples/cluster-import-schema-only-basicauth.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
apiVersion: postgresql.cnpg.io/v1 | ||
kind: Cluster | ||
metadata: | ||
name: cluster-pgdump | ||
spec: | ||
instances: 3 | ||
|
||
bootstrap: | ||
initdb: | ||
import: | ||
type: microservice | ||
schemaOnly: true | ||
databases: | ||
- app | ||
source: | ||
externalCluster: cluster-example | ||
storage: | ||
size: 1Gi | ||
externalClusters: | ||
- name: cluster-example | ||
connectionParameters: | ||
host: cluster-example-rw.default.svc | ||
user: postgres | ||
dbname: postgres | ||
password: | ||
name: cluster-example-superuser | ||
key: password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters