Files
buzz/docs
Phil Azar 8f83c63209 fix(db): preserve partition reader grants (#8485)
## Summary

PostgreSQL does not copy parent table grants to new partitions. A reader
can query the `events` parent but fail direct partition reads after the
relay creates another month or replaces its catch-all.

Copy each managed parent's explicit table-level `SELECT` grants to its
new children inside the existing maintenance transaction. The parent ACL
supplies the policy; there is no new setting or deployment-specific role
name. Writes, column-only grants, owner entries, and grant options are
excluded. A grant failure rolls back the table's partition changes.

Existing children and manually created or attached partitions still need
grants from database provisioning. Apply the [companion initializer
fix](https://github.com/squareup/bb-utility/pull/2253) for existing
partitions before relying on automatic grants for future ones.

### Related issue

No duplicate found. The closest related PR is #8464, which enables
catch-all advancement by default; this change independently preserves
reader access during that maintenance.

### Testing

No manual testing. Production rollout and the Fivetran setup check
remain pending.

Generated with Codex

Signed-off-by: coder2 <4acc49cb93576448ba82e631688c51a40bf03d6a889d78fddf57917d198de10f@buzz.block.builderlab.xyz>
Co-authored-by: coder2 <4acc49cb93576448ba82e631688c51a40bf03d6a889d78fddf57917d198de10f@buzz.block.builderlab.xyz>
2026-11-02 15:27:05 -05:00
..
2026-07-21 17:16:23 +00:00