Ask HN: Any good tools to pgdump multi tenant database?
3 polishdude20 4 5/16/2025, 6:48:35 PM
Just joined a new company and they run a multi tenant database in postgres where each tenant is distinguished by their account ID.
I'd like to be able to dump the data of a single account to my local instance to assist in debugging.
Problem is, many of the entities do not include an account ID. For example, a user can have an account ID but a user post will not but it will be tied to a user ID.
Also foreign keys aren't really implemented fully.
Are there any tools or techniques that could help make this process easier to do?
Also, since you said FK are not fully implemented, then there just won't be enough information for them to work with. So you can either work on fixing the foreign keys or have more complex scripts.
Yeah due to the unavailability of FK's, I'd have to somehow map certain ID columns to the tables they're for, accounting for slight naming convention differences.