Skip to content

Fix PostgreSQL 15 RLS predicate comparison context - #120

Merged
MelbourneDeveloper merged 8 commits into
mainfrom
refactor/deslop-ten-percent
Oct 4, 2026
Merged

MelbourneDeveloper merged 8 commits into
mainfrom
refactor/deslop-ten-percent

Conversation

@MelbourneDeveloper

Copy link
Copy Markdown
Collaborator

TLDR

Fix PostgreSQL 15 RLS migrations by comparing live and desired predicates in the same PostgreSQL relation context. Fixes #119.

What Was Added?

  • Normalized PostgreSQL schema inspection for the migration CLI.
  • A PostgreSQL 15.1 test collection reusing the shared PostgreSQL fixture.
  • Nine CLI/integration regressions covering fresh creation, unchanged reapply, USING and WITH CHECK changes, WITH CHECK-only INSERT policies, qualified/quoted columns, functions, negation, correlated subquery shadowing, and pre-commit rollback.

What Was Changed or Deleted?

  • Both initial PostgreSQL CLI inspection and inspection inside the pre-commit integrity callback normalize catalog policies through the same temporary-view mechanism already used for desired predicates.
  • Shared test fixture initialization accepts an explicit image; existing suites retain PostgreSQL 16.
  • Predicate qualification remains intact. Predicate drift detection, integrity verification, and transaction rollback remain enforced.

How Do The Automated Tests Prove It Works?

  • Before the fix, six PostgreSQL 15 regression cases failed with the reported predicate-drift integrity error. The same minimal case passed on PostgreSQL 16, explaining the previous coverage gap.
  • All nine PostgreSQL 15 cases now pass. The rollback test requires the exact integrity-rejection error and strict equivalence of the catalog policy after rollback, preventing an unrelated callback failure from satisfying the assertion.
  • Installed public DataProviderMigrate 0.10.0-beta reproduced the exact issue. The rebuilt CLI succeeds with that same YAML and database, then reruns with zero operations.
  • Full make ci passed after the latest edits against committed main plus these six files. Deslop is below the committed duplication ceiling; no new test clusters were reported.
  • Actual Pi read-only security review found no blockers.

Breaking Changes

  • None

@MelbourneDeveloper
MelbourneDeveloper enabled auto-merge (squash) October 4, 2026 05:44
@MelbourneDeveloper
MelbourneDeveloper merged commit 6610178 into main Oct 4, 2026
11 checks passed
@MelbourneDeveloper
MelbourneDeveloper deleted the refactor/deslop-ten-percent branch October 4, 2026 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0.10.0-beta: fresh PostgreSQL RLS migration fails integrity verification for using: id = 1

1 participant