Add documentation for row level security#133
Open
ElenaKrippner wants to merge 1 commit intomasterfrom
Open
Conversation
176079b to
95f7c36
Compare
ChrisWint
reviewed
Mar 12, 2026
Comment on lines
+140
to
+145
| For upserts, the table needs to be scanned to find the values to update but the policies are applied after finding those values (else, it would be possible to insert values that might have to be updated). | ||
|
|
||
| Select policies are also applied on the values of returning clauses of insert, update and delete statements and always on the output of upserts, even if there is no returning clause. | ||
|
|
||
| Usually, select policies silently filter the values. This is not the case on the output values of insert, update and upsert statements. | ||
|
|
Contributor
There was a problem hiding this comment.
This paragraph I find confusing, but the logic in Postgres is super confusing to begin with so I am not sure we can even do better here...
Contributor
Author
There was a problem hiding this comment.
I tried to rephrase it but I'm not sure if this is better.
| #### Update Policies | ||
|
|
||
| Update policies can have both an `using` and a `with check` expression. | ||
| The `using` expression silently filters the rows that may be updated for update statements, for upserts, an error might be thrown. |
Contributor
There was a problem hiding this comment.
Suggested change
| The `using` expression silently filters the rows that may be updated for update statements, for upserts, an error might be thrown. | |
| The `using` expression silently ignores the rows that may be updated for update statements. For upserts, an error might be thrown. |
Why might? Is that not always the case for violating rows?
Contributor
Author
There was a problem hiding this comment.
Because an error is only thrown if a row would be filtered and not always, but that is probably obvious 😅
ChrisWint
reviewed
Mar 12, 2026
95f7c36 to
ef24d4d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'd merge this once we have the release where we announce row level security.