1 /* contrib/pg_stat_statements/pg_stat_statements--1.7--1.8.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.8'" to load this file. \quit
6 /* First we have to remove them from the extension */
7 ALTER EXTENSION pg_stat_statements DROP VIEW pg_stat_statements;
8 ALTER EXTENSION pg_stat_statements DROP FUNCTION pg_stat_statements(boolean);
10 /* Then we can drop them */
11 DROP VIEW pg_stat_statements;
12 DROP FUNCTION pg_stat_statements(boolean);
15 CREATE FUNCTION pg_stat_statements(IN showtext boolean,
21 OUT total_plan_time float8,
22 OUT min_plan_time float8,
23 OUT max_plan_time float8,
24 OUT mean_plan_time float8,
25 OUT stddev_plan_time float8,
27 OUT total_exec_time float8,
28 OUT min_exec_time float8,
29 OUT max_exec_time float8,
30 OUT mean_exec_time float8,
31 OUT stddev_exec_time float8,
33 OUT shared_blks_hit int8,
34 OUT shared_blks_read int8,
35 OUT shared_blks_dirtied int8,
36 OUT shared_blks_written int8,
37 OUT local_blks_hit int8,
38 OUT local_blks_read int8,
39 OUT local_blks_dirtied int8,
40 OUT local_blks_written int8,
41 OUT temp_blks_read int8,
42 OUT temp_blks_written int8,
43 OUT blk_read_time float8,
44 OUT blk_write_time float8,
50 AS 'MODULE_PATHNAME', 'pg_stat_statements_1_8'
51 LANGUAGE C STRICT VOLATILE PARALLEL SAFE;
53 CREATE VIEW pg_stat_statements AS
54 SELECT * FROM pg_stat_statements(true);
56 GRANT SELECT ON pg_stat_statements TO PUBLIC;