Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 496899c

Browse files
committed
Update pg_stat_statements extension for parallel query.
All functions provided by this extension are PARALLEL SAFE. Given the general prohibition against write operations in parallel queries, it is perhaps a bit surprising that pg_stat_statements_reset() is parallel safe. But since it only modifies shared memory, not the database, it's OK. Andreas Karlsson
1 parent 3d8fc8c commit 496899c

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

contrib/pg_stat_statements/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ MODULE_big = pg_stat_statements
44
OBJS = pg_stat_statements.o $(WIN32RES)
55

66
EXTENSION = pg_stat_statements
7-
DATA = pg_stat_statements--1.3.sql pg_stat_statements--1.2--1.3.sql \
8-
pg_stat_statements--1.1--1.2.sql pg_stat_statements--1.0--1.1.sql \
9-
pg_stat_statements--unpackaged--1.0.sql
7+
DATA = pg_stat_statements--1.4.sql pg_stat_statements--1.3--1.4.sql \
8+
pg_stat_statements--1.2--1.3.sql pg_stat_statements--1.1--1.2.sql \
9+
pg_stat_statements--1.0--1.1.sql pg_stat_statements--unpackaged--1.0.sql
1010
PGFILEDESC = "pg_stat_statements - execution statistics of SQL statements"
1111

1212
LDFLAGS_SL += $(filter -lm, $(LIBS))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* contrib/pg_stat_statements/pg_stat_statements--1.3--1.4.sql */
2+
3+
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
4+
\echo Use "ALTER EXTENSION pg_stat_statements UPDATE TO '1.4'" to load this file. \quit
5+
6+
ALTER FUNCTION pg_stat_statements_reset() PARALLEL SAFE;
7+
ALTER FUNCTION pg_stat_statements(boolean) PARALLEL SAFE;

contrib/pg_stat_statements/pg_stat_statements--1.3.sql renamed to contrib/pg_stat_statements/pg_stat_statements--1.4.sql

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* contrib/pg_stat_statements/pg_stat_statements--1.3.sql */
1+
/* contrib/pg_stat_statements/pg_stat_statements--1.4.sql */
22

33
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
44
\echo Use "CREATE EXTENSION pg_stat_statements" to load this file. \quit
@@ -7,7 +7,7 @@
77
CREATE FUNCTION pg_stat_statements_reset()
88
RETURNS void
99
AS 'MODULE_PATHNAME'
10-
LANGUAGE C;
10+
LANGUAGE C PARALLEL SAFE;
1111

1212
CREATE FUNCTION pg_stat_statements(IN showtext boolean,
1313
OUT userid oid,
@@ -36,7 +36,7 @@ CREATE FUNCTION pg_stat_statements(IN showtext boolean,
3636
)
3737
RETURNS SETOF record
3838
AS 'MODULE_PATHNAME', 'pg_stat_statements_1_3'
39-
LANGUAGE C STRICT VOLATILE;
39+
LANGUAGE C STRICT VOLATILE PARALLEL SAFE;
4040

4141
-- Register a view on the function for ease of use.
4242
CREATE VIEW pg_stat_statements AS
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# pg_stat_statements extension
22
comment = 'track execution statistics of all SQL statements executed'
3-
default_version = '1.3'
3+
default_version = '1.4'
44
module_pathname = '$libdir/pg_stat_statements'
55
relocatable = true

0 commit comments

Comments
 (0)