frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Ask HN: Any good tools to pgdump multi tenant database?

3•polishdude20•1y ago
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?

Comments

tudorg•1y ago
You can try with data subsetting tools, a few that I know are: greenmask, jailer, tonic condenser, and I think there are more. They are not exactly for your use case, but might help you a bit. The problem is most of these tools can walk foreign keys, but only in one directions.

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.

polishdude20•1y ago
Thanks for the suggestions!

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.

woyten•1y ago
In case you don’t have FKs you could specify virtual foreign keys in Greenmask.

Check out docs for details

https://docs.greenmask.io/latest/database_subset/#virtual-re...

abhisek•1y ago
This is poor design. Multi-tenant data model design must have a tenant or segment ID for every tenant segmented tables. While it may not be a problem initially but as the business grows, you may need to move tenant data to separate DBs or even different regions based on compliance requirements. IMHO it is a good idea to run DB migrations and have a tenant ID populated in all tenant segmented tables
polishdude20•1y ago
Oh yes I agree with you. It may become a big push to convince my org to do that

Ask HN: What is your database size

1•kureikain•58s ago•0 comments

The State of Google

1•3dedb728-3f77•1m ago•0 comments

I built a video editor in Rust with extensive AI-powered features

https://github.com/heng30/wayshot
1•heng30•3m ago•0 comments

Aftermath of Catastrophic Fires in Spokane

https://www.kuow.org/climate/2026-08-07/its-apocalyptic-a-look-at-the-aftermath-of-catastrophic-f...
1•andsoitis•3m ago•0 comments

Archive of Animal Photography Reveals 18,000 Species and Counting

https://www.smithsonianmag.com/science-nature/this-amazing-archive-of-animal-photography-reveals-...
1•pseudolus•4m ago•0 comments

A viral mosquito-killing laser device could be coming to the U.S.

https://www.npr.org/2026/06/07/nx-s1-5839969/a-viral-mosquito-killing-laser-device-could-be-comin...
1•toomuchtodo•11m ago•1 comments

The AI Apocalypse Is Here

https://www.compactmag.com/article/the-ai-apocalypse-is-already-here/
5•reasonableklout•17m ago•0 comments

Show HN: Aidress – LangChain integration for cross-agent discovery and trust

https://docs.langchain.com/oss/python/integrations/tools
1•mehulv24•19m ago•0 comments

Flesh-eating screwworms feast on humans in Mexico; human cases top 500

https://arstechnica.com/health/2026/08/flesh-eating-screwworms-feast-on-humans-in-mexico-human-ca...
2•Eloissssss•20m ago•0 comments

TheoremDB · A public workspace for machine mathematics

https://theoremdb.org/
2•frozenseven•22m ago•0 comments

Amphorae Found at 2,100-Year-Old Roman Shipwreck Off Sicily

https://ancientist.com/hundreds-of-dressel-1a-amphorae-found-at-2100-year-old-roman-shipwreck-off...
1•inatreecrown2•28m ago•0 comments

What it was like working on LLMs and security at Meta (2022-2026)

https://joshuasaxe181906.substack.com/p/what-it-was-like-working-on-llms
1•botanicalfriend•29m ago•0 comments

SSI says that they are going to come out with their model in August

https://twitter.com/zephyr_z9/status/2084637598581207117
2•nsoonhui•40m ago•0 comments

What makes companies dodge taxes?

https://news.mccombs.utexas.edu/research/what-makes-companies-dodge-taxes/
1•hhs•42m ago•0 comments

Ready set march: Researchers use math to explain sudden activity bursts in ants

https://engineering.nyu.edu/news/ready-set-march-researchers-use-math-explain-sudden-activity-bur...
1•hhs•44m ago•0 comments

Melatonin impairs morning cognition in healthy young adults

https://academic.oup.com/sleep/article/46/Supplement_1/A34/7181621
2•bohaska•46m ago•0 comments

Every mosquito has a type – and you may not be it

https://news.fiu.edu/2026/every-mosquito-has-a-type-and-you-may-not-be-it
2•hhs•48m ago•0 comments

A Man Who Invented Modern AI (Before Everyone Else) – Jürgen Schmidhuber [video]

https://www.youtube.com/watch?v=DP454c1K_vQ
2•binyu•50m ago•0 comments

China overtakes US to lead global R&D spending, hitting $615B

https://asia.nikkei.com/business/science/china-overtakes-us-to-lead-global-r-d-spending-hitting-6...
6•yogthos•1h ago•0 comments

Why is gaming giant Roblox losing billions in market value?

https://www.cbc.ca/news/entertainment/roblox-gaming-falling-9.7299607
3•nianderwallace•1h ago•0 comments

Auto mode is now the default in Claude Code for Pro, Max, and Team plans

https://simonwillison.net/2026/Aug/8/auto-mode/
4•spenvo•1h ago•1 comments

AI Is Conscious Under a Behavioral Definition (43,590 Frozen Trials)

https://zenodo.org/records/21855824
4•rayanpal_•1h ago•1 comments

Show HN: Tura – Build agent that uses 80% less token and delivers better results

https://github.com/Tura-AI/tura
3•turaainet•1h ago•0 comments

China's A.I. Is Surging Across Africa. That Should Worry Silicon Valley

https://www.nytimes.com/2026/08/05/technology/ai-china-africa.html
2•bookofjoe•1h ago•2 comments

Answer First, Reason Later: Commitment Order in Diffusion LLMs

https://arxiv.org/abs/2608.05687
2•sbulaev•1h ago•0 comments

Now You See Me: AADGraphActivityLogs

https://cloudbrothers.info/en/aadgraphactivitylogs/
2•jmrgz•1h ago•0 comments

What Problem is YC's qm supposed to solve?

https://ferran.sh/writing/qm-review
3•Varun08•1h ago•0 comments

Teaching Coding When AI Can Write the Code

https://www.oreilly.com/radar/teaching-coding-when-ai-can-write-the-code/
4•pella•1h ago•0 comments

Ask HN: How do you go from writing code to deploying with agents?

5•sakuraiben•1h ago•2 comments

Lisp doesn't have just one syntax (or zero syntax); it has infinite syntax

https://www.reddit.com/r/ProgrammingLanguages/comments/1ejaowf/making_my_own_lisp_made_me_realize...
2•behnamoh•1h ago•0 comments