Hi Developers, In pg_stat_statements.c, the function pg_stat_statements_internal() declares the queryid variable as int64, but assigns it a value of type uint64. At first glance, this might appear to be an overflow issue. However, I think this is intentional - the queryid is cast to int64 to match the bigint type of the queryid column in the pg_stat_statements view.
Please find the attached patch, which adds a clarifying comment to make the rationale explicit and avoid potential confusion for future readers. Thanks and Regards, Shaik Mohammad Mujeeb Member Technical Staff Zoho Corp
add_comment_for_why_queryid_is_int64.patch
Description: Binary data