Tables not empty

The tables in the target database contain existing data. By default, the subsetter requires empty target tables to prevent accidental data loss.

How to fix

Choose one of these approaches:

Option 1: Clear target database manually

  1. Backup your target database (if needed)
  2. Delete existing data from target tables
  3. Re-run the subsetter with empty tables

Option 2: Use overwrite mode

Run the subsetter with the overwrite flag:

rgsubset run --target-database-write-mode overwrite [other options]
Warning: This will delete all existing data in target tables that are being subsetted.

Understanding write modes

Strict (default): Fails if target tables contain data - prevents accidental overwrites

Overwrite: Automatically deletes existing data before subsetting - use with caution

When to use overwrite mode 

Development environments: Safe to replace test data

Iterative subsetting: Running multiple subset operations on the same target

Known empty requirement: When you're certain existing data should be replaced



Didn't find what you were looking for?