Update pg_buffercache extension for parallel query.
authorRobert Haas <rhaas@postgresql.org>
Thu, 9 Jun 2016 21:18:12 +0000 (17:18 -0400)
committerRobert Haas <rhaas@postgresql.org>
Thu, 9 Jun 2016 21:18:12 +0000 (17:18 -0400)
The pg_buffercache_pages function provided by this extension is
PARALLEL SAFE.

Andreas Karlsson

contrib/pg_buffercache/Makefile
contrib/pg_buffercache/pg_buffercache--1.1--1.2.sql [new file with mode: 0644]
contrib/pg_buffercache/pg_buffercache--1.2.sql [moved from contrib/pg_buffercache/pg_buffercache--1.1.sql with 90% similarity]
contrib/pg_buffercache/pg_buffercache.control

index 065d3d690a97e5124ea36619c462b3727d24efe5..497dbeb2297735ed436326912ff3121ffe8e53d7 100644 (file)
@@ -4,7 +4,8 @@ MODULE_big = pg_buffercache
 OBJS = pg_buffercache_pages.o $(WIN32RES)
 
 EXTENSION = pg_buffercache
-DATA = pg_buffercache--1.1.sql pg_buffercache--1.0--1.1.sql pg_buffercache--unpackaged--1.0.sql
+DATA = pg_buffercache--1.2.sql pg_buffercache--1.1--1.2.sql \
+   pg_buffercache--1.0--1.1.sql pg_buffercache--unpackaged--1.0.sql
 PGFILEDESC = "pg_buffercache - monitoring of shared buffer cache in real-time"
 
 ifdef USE_PGXS
diff --git a/contrib/pg_buffercache/pg_buffercache--1.1--1.2.sql b/contrib/pg_buffercache/pg_buffercache--1.1--1.2.sql
new file mode 100644 (file)
index 0000000..5997aad
--- /dev/null
@@ -0,0 +1,6 @@
+/* contrib/pg_buffercache/pg_buffercache--1.1--1.2.sql */
+
+-- complain if script is sourced in psql, rather than via ALTER EXTENSION
+\echo Use "ALTER EXTENSION pg_buffercache UPDATE TO '1.2'" to load this file. \quit
+
+ALTER FUNCTION pg_buffercache_pages() PARALLEL SAFE;
similarity index 90%
rename from contrib/pg_buffercache/pg_buffercache--1.1.sql
rename to contrib/pg_buffercache/pg_buffercache--1.2.sql
index f3b6482fa6258912e0d7642e5ca4eb2193708082..6ee5d8435bdc7aeffc45cb35b116cf87485fa063 100644 (file)
@@ -1,4 +1,4 @@
-/* contrib/pg_buffercache/pg_buffercache--1.1.sql */
+/* contrib/pg_buffercache/pg_buffercache--1.2.sql */
 
 -- complain if script is sourced in psql, rather than via CREATE EXTENSION
 \echo Use "CREATE EXTENSION pg_buffercache" to load this file. \quit
@@ -7,7 +7,7 @@
 CREATE FUNCTION pg_buffercache_pages()
 RETURNS SETOF RECORD
 AS 'MODULE_PATHNAME', 'pg_buffercache_pages'
-LANGUAGE C;
+LANGUAGE C PARALLEL SAFE;
 
 -- Create a view for convenient access.
 CREATE VIEW pg_buffercache AS
index 5494e2fae521a122507e3cb7a179050ded1fcdd7..a4d664f3fa7c1c583fc7b4424c7df4437fc3c0a3 100644 (file)
@@ -1,5 +1,5 @@
 # pg_buffercache extension
 comment = 'examine the shared buffer cache'
-default_version = '1.1'
+default_version = '1.2'
 module_pathname = '$libdir/pg_buffercache'
 relocatable = true