1 /* contrib/pg_stat_statements/pg_stat_statements--1.4.sql */
3 -- complain if script is sourced in psql, rather than via CREATE EXTENSION
4 \echo Use "CREATE EXTENSION pg_stat_statements" to load this file. \quit
7 CREATE FUNCTION pg_stat_statements_reset()
10 LANGUAGE C PARALLEL SAFE;
12 CREATE FUNCTION pg_stat_statements(IN showtext boolean,
18 OUT total_time float8,
22 OUT stddev_time float8,
24 OUT shared_blks_hit int8,
25 OUT shared_blks_read int8,
26 OUT shared_blks_dirtied int8,
27 OUT shared_blks_written int8,
28 OUT local_blks_hit int8,
29 OUT local_blks_read int8,
30 OUT local_blks_dirtied int8,
31 OUT local_blks_written int8,
32 OUT temp_blks_read int8,
33 OUT temp_blks_written int8,
34 OUT blk_read_time float8,
35 OUT blk_write_time float8
38 AS 'MODULE_PATHNAME', 'pg_stat_statements_1_3'
39 LANGUAGE C STRICT VOLATILE PARALLEL SAFE;
41 -- Register a view on the function for ease of use.
42 CREATE VIEW pg_stat_statements AS
43 SELECT * FROM pg_stat_statements(true);
45 GRANT SELECT ON pg_stat_statements TO PUBLIC;
47 -- Don't want this to be available to non-superusers.
48 REVOKE ALL ON FUNCTION pg_stat_statements_reset() FROM PUBLIC;