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