Skip to content

Conversation

martykulma
Copy link
Contributor

@martykulma martykulma commented Oct 6, 2025

Add checks to PG source purification to require BYPASSRLS if any of the tables has a row level security policy that affects the MZ user or public.

Motivation

fixes https://github.com/MaterializeInc/database-issues/issues/9752

Checklist

  • This PR has adequate test coverage / QA involvement has been duly considered. (trigger-ci for additional test/nightly runs)
  • This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
  • If this PR evolves an existing $T ⇔ Proto$T mapping (possibly in a backwards-incompatible way), then it is tagged with a T-proto label.
  • If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label (example).
  • If this PR includes major user-facing behavior changes, I have pinged the relevant PM to schedule a changelog post.

@martykulma martykulma marked this pull request as ready for review October 7, 2025 01:13
@martykulma martykulma requested review from a team as code owners October 7, 2025 01:13
Copy link
Contributor

@petrosagg petrosagg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! We might want to check that during the transaction that executes the COPY as well to avoid a time of check time of use type of problem

@martykulma
Copy link
Contributor Author

Nice! We might want to check that during the transaction that executes the COPY as well to avoid a time of check time of use type of problem

Good point, will add it there as well - TY!

@martykulma martykulma force-pushed the maz-pg-rls branch 2 times, most recently from 1c4f397 to ae91aef Compare October 8, 2025 18:04
@martykulma martykulma requested a review from petrosagg October 8, 2025 18:57
@martykulma
Copy link
Contributor Author

@petrosagg I feel I made enough changes to warrant a second glance. Instead of returning the list of RLS affected tables in Ok(), I now return in a PostgresError. I was just returning the result and then turning it into an error at every call site.

Thank you!

@martykulma
Copy link
Contributor Author

Checked in with @petrosagg last week over slack, this is good to go.

@martykulma martykulma merged commit 45d7c63 into MaterializeInc:main Oct 14, 2025
129 checks passed
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.

2 participants