1 /* contrib/pg_stat_statements/pg_stat_statements--1.1--1.2.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.2'" 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();
10 /* Then we can drop them */
11 DROP VIEW pg_stat_statements;
12 DROP FUNCTION pg_stat_statements();
15 CREATE FUNCTION pg_stat_statements(IN showtext boolean,
21 OUT total_time float8,
23 OUT shared_blks_hit int8,
24 OUT shared_blks_read int8,
25 OUT shared_blks_dirtied int8,
26 OUT shared_blks_written int8,
27 OUT local_blks_hit int8,
28 OUT local_blks_read int8,
29 OUT local_blks_dirtied int8,
30 OUT local_blks_written int8,
31 OUT temp_blks_read int8,
32 OUT temp_blks_written int8,
33 OUT blk_read_time float8,
34 OUT blk_write_time float8
37 AS 'MODULE_PATHNAME', 'pg_stat_statements_1_2'
38 LANGUAGE C STRICT VOLATILE;
40 CREATE VIEW pg_stat_statements AS
41 SELECT * FROM pg_stat_statements(true);
43 GRANT SELECT ON pg_stat_statements TO PUBLIC;