Allow seeing query texts for inherited roles in pg_stat_statements (#20) #685
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.
Today, if you don't have pg_monitor (pg_read_all_stats, specifically), you can only see your own query texts in pg_stat_statements. This limits the usefulness quite a bit because we're not ready to give out pg_monitor yet.
pg_stat_activity however is more lax and lets you see the query text of roles you inherit the privileges of. See
here.
This PR aligns the behavior of pg_stat_statements with pg_stat_activity. Later in PrPr when we give out pg_monitor, we can choose whether we keep this or not.
I manually verified the new behavior. Will follow up with an automated test as a fast-follow to PrPr for the final behavior when we give out pg_monitor. Manual test: