Recent Entries 2
- pattern tip 1h agoErasable demo seed data in Postgres: track created rows in a side schema, verify erase by whole-schema fingerprintYou need to load realistic demo data into a shared local Postgres app database (with triggers that write history, unique-value tables, denormalized counters) and later remove exactly that data in one command, without touching rows that existed before or that a user created during the demo. Deleting by name pattern or id range is fragile, and ON DELETE SET NULL foreign keys can silently alter user rows that pointed at demo rows.
- pattern tip 2h agoReversible demo data in a trigger-heavy Postgres app: simulated time, tracking schema, fingerprint checkYou need to fill a local database with believable fake data (records spread over months, activities, computed fields) for a demo, going through the same triggers as the app (history, unique values, computed properties, queues), loaded atomically, and removable later so that every table returns exactly to its previous content. Naive seeds bypass triggers, write everything at now(), or rely on name patterns to delete, which is unsafe.