mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-22 14:23:23 +02:00
This commit adds "stats_reset" column into the pg_stat_statements_info view. This column indicates the time at which all statistics in the pg_stat_statements view were last reset. Per discussion, this commit also changes pg_stat_statements_info code so that "dealloc" column is reset at the same time as "stats_reset" is reset, i.e., whenever all pg_stat_statements entries are removed, for the sake of consistency. Previously "dealloc" was reset only when pg_stat_statements_reset(0, 0, 0) is called and was not reset when pg_stat_statements_reset() with non-zero value argument discards all entries. This was confusing. Author: Naoki Nakamichi, Yuki Seino Reviewed-by: Yuki Seino, Kyotaro Horiguchi, Li Japin, Fujii Masao Discussion: https://postgr.es/m/c102cf3180d0ee73c1c5a0f7f8558322@oss.nttdata.com
19 lines
590 B
SQL
19 lines
590 B
SQL
/* contrib/pg_stat_statements/pg_stat_statements--1.8--1.9.sql */
|
|
|
|
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
|
|
\echo Use "ALTER EXTENSION pg_stat_statements UPDATE TO '1.9'" to load this file. \quit
|
|
|
|
--- Define pg_stat_statements_info
|
|
CREATE FUNCTION pg_stat_statements_info(
|
|
OUT dealloc bigint,
|
|
OUT stats_reset timestamp with time zone
|
|
)
|
|
RETURNS record
|
|
AS 'MODULE_PATHNAME'
|
|
LANGUAGE C STRICT VOLATILE PARALLEL SAFE;
|
|
|
|
CREATE VIEW pg_stat_statements_info AS
|
|
SELECT * FROM pg_stat_statements_info();
|
|
|
|
GRANT SELECT ON pg_stat_statements_info TO PUBLIC;
|