Sync-Deleted
Detects rows that have been deleted in MS Access and removes them from PostgreSQL.
replicator-ng -c config.toml --sync-deleted
How It Works
- Tables are processed in FK dependency order — child tables first, then parents (prevents cascade-delete constraint violations)
- For each table, rows are fetched from PostgreSQL in keyed batches
- Each batch is checked against Access:
SELECT COUNT(*) FROM [Table] WHERE pk = ? - Rows not found in Access are deleted from PostgreSQL
The --slow Option
By default, sync-deleted only processes tables where Access and PostgreSQL row counts differ. With --slow, every table is processed regardless:
replicator-ng -c config.toml --sync-deleted --slow
Requirements
- The table must have a primary key or unique constraint in PostgreSQL
- Composite keys are supported (multi-column tuple comparison)
- Tables without keys are skipped with a warning
Nonvolatile Tables
Skip tables whose data hasn't changed since the last replication run.
Configuration
Mark tables as nonvolatile in your config:
nonvolatile = ["PostalCodes", "Regions", "ProductCategories"]
Or tick the Nonvolatile checkbox in the GUI's Tables panel.
How It Works
- Before copying, the Access row count is compared to the PostgreSQL row count
- If counts match → table is skipped entirely (assumes unchanged)
- If counts differ → table is copied as normal
No hashes or stored state — just a simple row-count comparison each run. Matches pg_replicator.py behaviour exactly.
Use --slow to override — copy all tables regardless of row-count match.
Simple Names
Create lowercase table and column names without quoted identifiers.
replicator-ng -c config.toml --schema --simple-names
What It Does
- Converts all table and column names to lowercase
- Replaces special characters (
/,-, spaces) with underscores - Removes quoted identifiers — no need for
"TableName"syntax in SQL queries - Must be used with
--schema(schema-only mode)
order_details just works.
Create Views
Generate readable views on top of replicated tables.
replicator-ng -c config.toml --create-views
Creates a view_TABLENAME for each replicated table. Views select all columns with human-friendly aliases and can apply transformations.
Adjust MS Access
The --adjust-ms-access flag creates indexes directly in your .accdb / .mdb file. Take a full backup of your database before running this command. While the changes are safe (only adding indexes), there is no undo — and a database analyst should verify that added indexes don't negatively impact Access performance.
Add missing indexes to the Access database to support foreign key relationships.
replicator-ng -c config.toml --adjust-ms-access
What It Does
MS Access relationships don't always have the indexes that PostgreSQL foreign keys require. This mode:
- Analyses all Access relationships (with "Enforce Referential Integrity" enabled)
- Identifies child-table columns that lack indexes
- Creates the missing indexes directly in the
.accdb/.mdbfile
This is primarily useful before the initial replication — once indexes exist, the replicator can create proper FK constraints in PostgreSQL.