On 2024/04/23 15:44, kuroda.keis...@nttcom.co.jp wrote:
Hi hackers, I proposal adding privileges test to improve test coverage of pg_stat_statements.
+1 Here are the review comments: meson.build needs to be updated as well, like the Makefile. For the privileges test, should we explicitly set pg_stat_statements.track_utility at the start, as done in other pg_stat_statements tests, to make sure if utility command statistics are collected or not? +SELECT + CASE + WHEN queryid <> 0 THEN TRUE ELSE FALSE + END AS queryid_bool + ,query FROM pg_stat_statements ORDER BY query COLLATE "C"; Can't we simplify "CASE ... END" to just "queryid <> 0"? Should the test check not only queryid and query but also the statistics column like "calls"? Roles that aren't superusers or pg_read_all_stats should be able to see statistics but not query or queryid. So we should test that such roles can't see query or queryid but can see statistics. Thoughts? Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION