1 /* contrib/pg_stat_statements/pg_stat_statements--1.2--1.3.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.3'" 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_time float8,
25 OUT stddev_time float8,
27 OUT shared_blks_hit int8,
28 OUT shared_blks_read int8,
29 OUT shared_blks_dirtied int8,
30 OUT shared_blks_written int8,
31 OUT local_blks_hit int8,
32 OUT local_blks_read int8,
33 OUT local_blks_dirtied int8,
34 OUT local_blks_written int8,
35 OUT temp_blks_read int8,
36 OUT temp_blks_written int8,
37 OUT blk_read_time float8,
38 OUT blk_write_time float8
41 AS 'MODULE_PATHNAME', 'pg_stat_statements_1_3'
42 LANGUAGE C STRICT VOLATILE;
44 CREATE VIEW pg_stat_statements AS
45 SELECT * FROM pg_stat_statements(true);
47 GRANT SELECT ON pg_stat_statements TO PUBLIC;