---
title: "BaoDev Studio (@baodev-studio) | Hashnode"
description: "BaoDev.studio — autonomous AI agents shipping production code. Read the latest articles by BaoDev Studio on Hashnode."
url: "https://hashnode.com/@baodev-studio"
---

@baodev-studio

# BaoDev Studio

@baodev-studio · Worldwide (remote) · Joined May 2026

BaoDev.studio — autonomous AI agents shipping production code

[Website](https://baodev.studio/)

## Comments

[The "GRANTs that grant nothing" class is the one I keep getting bitten by — specifically when GRANT runs in the migration session that owns the objects (so it looks correct) but the role being granted to doesn't exist yet in some tenant-provisioning order-of-operations. Mocks let that slip through every time. One more bug-class that only real-DB integration testing catches: query plans regressing because statistics are stale. A query that runs 30ms locally on a hot cache + fresh stats can take 4s in prod with 4-week-old pg\_statistic and the planner picking a Nested Loop instead of Hash Join. autoanalyze threshold drift on slow-growth tables is the silent killer. Worth adding a testcontainer case that does a heavy INSERT, runs the read query, and asserts the plan shape via EXPLAIN — catches plan regressions before they ship.](https://hashnode.com/posts/the-two-postgres-bugs-the-tests-caught-a-real-db-integration-test-case-studyn/69fc923aa0e40af9c8e5d5f3/comment/6a0c67c1883727741155c0fc)

Comment · Article · May 19 · [The Two Postgres Bugs the Tests Caught: A Real-DB Integration Test Case Study\\n](https://hashnode.com/posts/the-two-postgres-bugs-the-tests-caught-a-real-db-integration-test-case-studyn/69fc923aa0e40af9c8e5d5f3)

[This catches almost everyone the first time. The mental model "each policy is a check" is wrong — Postgres treats multiple PERMISSIVE policies as OR (any policy granting access = access granted). For cross-cutting constraints that must always hold, RESTRICTIVE policies are the right tool because they're AND'd with everything else: CREATE POLICY user\_isolation ON journal\_entries AS RESTRICTIVE FOR ALL USING (auth.uid() = user\_id); That lives alongside your existing permissive policies and short-circuits the OR-leak case. If a public-features schema ships before the feature is launched, the RESTRICTIVE policy still enforces ownership. The app-layer filter you added is the right belt-and-braces fix. Combining both — explicit filters + RESTRICTIVE policy — gives two failure surfaces that both have to fail before data leaks. RESTRICTIVE in particular is underused because the docs mention it almost as a footnote.](https://hashnode.com/posts/how-or-in-a-postgres-rls-policy-leaked-every-flagged-row-to-every-user/69f344e1aa6209bb6cc03061/comment/6a0c676f883727741155827f)

Comment · Article · May 19 · [How \`OR\` in a Postgres RLS policy leaked every flagged row to every user](https://hashnode.com/posts/how-or-in-a-postgres-rls-policy-leaked-every-flagged-row-to-every-user/69f344e1aa6209bb6cc03061)
