Re: Add privileges test for pg_stat_statements to improve coverage - Mailing list pgsql-hackers

From kuroda.keisuke@nttcom.co.jp
Subject Re: Add privileges test for pg_stat_statements to improve coverage
Date
Msg-id 488263fb2634162199affe740e07a407@nttcom.co.jp
Whole thread Raw
In response to Re: Add privileges test for pg_stat_statements to improve coverage  (Fujii Masao <masao.fujii@oss.nttdata.com>)
List pgsql-hackers
Hi Fujii-san,
Thank you for your reply and comment!

attach v3 fixed patch.

> Shouldn't we also include calls and rows in the ORDER BY clause?
> Without this, if there are multiple records with the same query
> but different calls or rows, the query result might be unstable.
> I believe this is causing the test failure reported by
> he PostgreSQL Patch Tester.

> I was thinking of adding "queryid <> 0" in the SELECT clause
> instead of the WHERE clause. This way, we can verify if
> the query results are as expected regardless of the queryid value,
> including both queryid <> 0 and queryid = 0.

It's exactly as you said.
* Add calls and rows in the ORDER BY caluse.
* Modify "queryid <> 0" in the SELECT clause.
Modify test SQL belows, and the regress_stats_user1 check SQL
only needs to be done once.

+SELECT queryid <> 0 AS queryid_bool, query, calls, rows
+  FROM pg_stat_statements
+  ORDER BY query COLLATE "C", calls, rows;

Best Regards,
Keisuke Kuroda
NTT Comware
Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Vacuum ERRORs out considering freezing dead tuples from before OldestXmin
Next
From: Tom Lane
Date:
Subject: Re: Vacuum ERRORs out considering freezing dead tuples from before OldestXmin