1 /* contrib/pg_stat_statements/pg_stat_statements--1.10--1.11.sql */
3 -- complain if script is sourced in psql, rather than via ALTER EXTENSION
4 \echo Use "ALTER EXTENSION pg_stat_statements UPDATE TO '1.11'" to load this file. \quit
6 /* Drop old versions */
7 DROP VIEW pg_stat_statements;
8 DROP FUNCTION pg_stat_statements(boolean);
9 DROP FUNCTION pg_stat_statements_reset(Oid, Oid, bigint);
12 CREATE FUNCTION pg_stat_statements(IN showtext boolean,
19 OUT total_plan_time float8,
20 OUT min_plan_time float8,
21 OUT max_plan_time float8,
22 OUT mean_plan_time float8,
23 OUT stddev_plan_time float8,
25 OUT total_exec_time float8,
26 OUT min_exec_time float8,
27 OUT max_exec_time float8,
28 OUT mean_exec_time float8,
29 OUT stddev_exec_time float8,
31 OUT shared_blks_hit int8,
32 OUT shared_blks_read int8,
33 OUT shared_blks_dirtied int8,
34 OUT shared_blks_written int8,
35 OUT local_blks_hit int8,
36 OUT local_blks_read int8,
37 OUT local_blks_dirtied int8,
38 OUT local_blks_written int8,
39 OUT temp_blks_read int8,
40 OUT temp_blks_written int8,
41 OUT shared_blk_read_time float8,
42 OUT shared_blk_write_time float8,
43 OUT local_blk_read_time float8,
44 OUT local_blk_write_time float8,
45 OUT temp_blk_read_time float8,
46 OUT temp_blk_write_time float8,
49 OUT wal_bytes numeric,
50 OUT jit_functions int8,
51 OUT jit_generation_time float8,
52 OUT jit_inlining_count int8,
53 OUT jit_inlining_time float8,
54 OUT jit_optimization_count int8,
55 OUT jit_optimization_time float8,
56 OUT jit_emission_count int8,
57 OUT jit_emission_time float8,
58 OUT jit_deform_count int8,
59 OUT jit_deform_time float8,
60 OUT stats_since timestamp with time zone,
61 OUT minmax_stats_since timestamp with time zone
64 AS 'MODULE_PATHNAME', 'pg_stat_statements_1_11'
65 LANGUAGE C STRICT VOLATILE PARALLEL SAFE;
67 CREATE VIEW pg_stat_statements AS
68 SELECT * FROM pg_stat_statements(true);
70 GRANT SELECT ON pg_stat_statements TO PUBLIC;
72 CREATE FUNCTION pg_stat_statements_reset(IN userid Oid DEFAULT 0,
73 IN dbid Oid DEFAULT 0,
74 IN queryid bigint DEFAULT 0,
75 IN minmax_only boolean DEFAULT false
77 RETURNS timestamp with time zone
78 AS 'MODULE_PATHNAME', 'pg_stat_statements_reset_1_11'
79 LANGUAGE C STRICT PARALLEL SAFE;
81 -- Don't want this to be available to non-superusers.
82 REVOKE ALL ON FUNCTION pg_stat_statements_reset(Oid, Oid, bigint, boolean) FROM PUBLIC;