Tables not empty
Published 06 March 2025
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
- Backup your target database (if needed)
- Delete existing data from target tables
- 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]
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