Sample Header Ad - 728x90

Unable to use equal operator in where clause on `queryid` from `pg_stat_statements`

0 votes
0 answers
94 views
When analyzing an issue on a PostgreSQL 13 server we can successfully retrieve information querying from pg_stat_statements, but we are unable to retrieve a single record using a queryid = -1234567600 in the where clause. So this does not work:
-- given that queryid -1234567600 really exists
select query, queryid from pg_stat_statements where queryid = -1234567600;
But the strange thing is, this DOES work:
SELECT                                                                          
    queryid,                                                                    
    query                                       
FROM                                                                            
    pg_stat_statements                                                          
where
    queryid=-1234567700;
I was under the impression that the former should also work. Am I misunderstanding things? Thanks!
Asked by Justin Zandbergen (1 rep)
Feb 10, 2022, 10:24 AM