Skip to content
Discussion options

You must be logged in to vote

Hi @smozely !

You can configure the snapshot to clean the target database. This will drop and recreate the relevant schema objects, which will give you the same effect as the truncate.

You can enable it by:

  • Setting the config field to true in the yaml configuration (source.postgres.snapshot.schema.pgdump_pgrestore.clean_target_db)
source:
  postgres:
   [...]
    snapshot: 
      schema: 
       [...]
        pgdump_pgrestore:
          clean_target_db: true # whether to clean the target database before restoring. Defaults to false
  • Setting the environment variable to true (PGSTREAM_POSTGRES_SNAPSHOT_CLEAN_TARGET_DB)
  • Passing the --reset flag to the pgstream snapshot command

You can fin…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by eminano
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants