From a8501ba11931f84c07e014070902d8198fa7dfd9 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Fri, 10 Jun 2016 10:42:03 -0400 Subject: [PATCH] Update pgstattuple extension for parallel query. All functions provided by this extension are PARALLEL SAFE. Andreas Karlsson --- contrib/pgstattuple/Makefile | 4 +++- contrib/pgstattuple/pgstattuple--1.3--1.4.sql | 13 +++++++++++++ ...pgstattuple--1.3.sql => pgstattuple--1.4.sql} | 16 ++++++++-------- contrib/pgstattuple/pgstattuple.control | 2 +- 4 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 contrib/pgstattuple/pgstattuple--1.3--1.4.sql rename contrib/pgstattuple/{pgstattuple--1.3.sql => pgstattuple--1.4.sql} (92%) diff --git a/contrib/pgstattuple/Makefile b/contrib/pgstattuple/Makefile index 6083dabefd..e732680dea 100644 --- a/contrib/pgstattuple/Makefile +++ b/contrib/pgstattuple/Makefile @@ -4,7 +4,9 @@ MODULE_big = pgstattuple OBJS = pgstattuple.o pgstatindex.o pgstatapprox.o $(WIN32RES) EXTENSION = pgstattuple -DATA = pgstattuple--1.3.sql pgstattuple--1.2--1.3.sql pgstattuple--1.1--1.2.sql pgstattuple--1.0--1.1.sql pgstattuple--unpackaged--1.0.sql +DATA = pgstattuple--1.4.sql pgstattuple--1.3--1.4.sql \ + pgstattuple--1.2--1.3.sql pgstattuple--1.1--1.2.sql \ + pgstattuple--1.0--1.1.sql pgstattuple--unpackaged--1.0.sql PGFILEDESC = "pgstattuple - tuple-level statistics" REGRESS = pgstattuple diff --git a/contrib/pgstattuple/pgstattuple--1.3--1.4.sql b/contrib/pgstattuple/pgstattuple--1.3--1.4.sql new file mode 100644 index 0000000000..913065026f --- /dev/null +++ b/contrib/pgstattuple/pgstattuple--1.3--1.4.sql @@ -0,0 +1,13 @@ +/* contrib/pgstattuple/pgstattuple--1.3--1.4.sql */ + +-- complain if script is sourced in psql, rather than via ALTER EXTENSION +\echo Use "ALTER EXTENSION pgstattuple UPDATE TO '1.4'" to load this file. \quit + +ALTER FUNCTION pgstattuple(text) PARALLEL SAFE; +ALTER FUNCTION pgstatindex(text) PARALLEL SAFE; +ALTER FUNCTION pg_relpages(text) PARALLEL SAFE; +ALTER FUNCTION pgstatginindex(regclass) PARALLEL SAFE; +ALTER FUNCTION pgstattuple(regclass) PARALLEL SAFE; +ALTER FUNCTION pgstatindex(regclass) PARALLEL SAFE; +ALTER FUNCTION pg_relpages(regclass) PARALLEL SAFE; +ALTER FUNCTION pgstattuple_approx(regclass) PARALLEL SAFE; diff --git a/contrib/pgstattuple/pgstattuple--1.3.sql b/contrib/pgstattuple/pgstattuple--1.4.sql similarity index 92% rename from contrib/pgstattuple/pgstattuple--1.3.sql rename to contrib/pgstattuple/pgstattuple--1.4.sql index f3996e74a8..69f2002566 100644 --- a/contrib/pgstattuple/pgstattuple--1.3.sql +++ b/contrib/pgstattuple/pgstattuple--1.4.sql @@ -14,7 +14,7 @@ CREATE FUNCTION pgstattuple(IN relname text, OUT free_space BIGINT, -- free space in bytes OUT free_percent FLOAT8) -- free space in % AS 'MODULE_PATHNAME', 'pgstattuple' -LANGUAGE C STRICT; +LANGUAGE C STRICT PARALLEL SAFE; CREATE FUNCTION pgstatindex(IN relname text, OUT version INT, @@ -28,12 +28,12 @@ CREATE FUNCTION pgstatindex(IN relname text, OUT avg_leaf_density FLOAT8, OUT leaf_fragmentation FLOAT8) AS 'MODULE_PATHNAME', 'pgstatindex' -LANGUAGE C STRICT; +LANGUAGE C STRICT PARALLEL SAFE; CREATE FUNCTION pg_relpages(IN relname text) RETURNS BIGINT AS 'MODULE_PATHNAME', 'pg_relpages' -LANGUAGE C STRICT; +LANGUAGE C STRICT PARALLEL SAFE; /* New stuff in 1.1 begins here */ @@ -42,7 +42,7 @@ CREATE FUNCTION pgstatginindex(IN relname regclass, OUT pending_pages INT4, OUT pending_tuples BIGINT) AS 'MODULE_PATHNAME', 'pgstatginindex' -LANGUAGE C STRICT; +LANGUAGE C STRICT PARALLEL SAFE; /* New stuff in 1.2 begins here */ @@ -57,7 +57,7 @@ CREATE FUNCTION pgstattuple(IN reloid regclass, OUT free_space BIGINT, -- free space in bytes OUT free_percent FLOAT8) -- free space in % AS 'MODULE_PATHNAME', 'pgstattuplebyid' -LANGUAGE C STRICT; +LANGUAGE C STRICT PARALLEL SAFE; CREATE FUNCTION pgstatindex(IN relname regclass, OUT version INT, @@ -71,12 +71,12 @@ CREATE FUNCTION pgstatindex(IN relname regclass, OUT avg_leaf_density FLOAT8, OUT leaf_fragmentation FLOAT8) AS 'MODULE_PATHNAME', 'pgstatindexbyid' -LANGUAGE C STRICT; +LANGUAGE C STRICT PARALLEL SAFE; CREATE FUNCTION pg_relpages(IN relname regclass) RETURNS BIGINT AS 'MODULE_PATHNAME', 'pg_relpagesbyid' -LANGUAGE C STRICT; +LANGUAGE C STRICT PARALLEL SAFE; /* New stuff in 1.3 begins here */ @@ -92,4 +92,4 @@ CREATE FUNCTION pgstattuple_approx(IN reloid regclass, OUT approx_free_space BIGINT, -- estimated free space in bytes OUT approx_free_percent FLOAT8) -- free space in % (based on estimate) AS 'MODULE_PATHNAME', 'pgstattuple_approx' -LANGUAGE C STRICT; +LANGUAGE C STRICT PARALLEL SAFE; diff --git a/contrib/pgstattuple/pgstattuple.control b/contrib/pgstattuple/pgstattuple.control index c03b180143..fa328fd664 100644 --- a/contrib/pgstattuple/pgstattuple.control +++ b/contrib/pgstattuple/pgstattuple.control @@ -1,5 +1,5 @@ # pgstattuple extension comment = 'show tuple-level statistics' -default_version = '1.3' +default_version = '1.4' module_pathname = '$libdir/pgstattuple' relocatable = true -- 2.40.0