pgschema icon indicating copy to clipboard operation
pgschema copied to clipboard

Reject or normalize duplicate default privileges to prevent perpetual drift

Open Goldziher opened this issue 1 month ago • 1 comments

Parent: #627

A default-privilege declaration can contain duplicate names such as ["SELECT", "SELECT"].

Reproduced in manifest validation: duplicates survive normalization, while inspected privileges are stored as a map. The desired list length therefore never equals the actual privilege set, so every replan emits the same REVOKE/GRANT sequence.

Required behavior: reject duplicates with a clear validation error or normalize them to a unique sorted set before planning. Add plan/apply/zero-drift coverage.

Goldziher avatar Oct 09 '26 09:10 Goldziher

Tracked under #627. A proposed implementation is in #637, which is still under discussion. Closing this sub-issue since it is covered by the #627 umbrella.

tianzhou avatar Oct 15 '26 03:10 tianzhou