Update pg_freespacemap extension for parallel query.
All functions provided by this extension are PARALLEL SAFE. Andreas Karlsson
This commit is contained in:
parent
0dbf3ce0e0
commit
42d4257a06
@ -4,7 +4,8 @@ MODULE_big = pg_freespacemap
|
|||||||
OBJS = pg_freespacemap.o $(WIN32RES)
|
OBJS = pg_freespacemap.o $(WIN32RES)
|
||||||
|
|
||||||
EXTENSION = pg_freespacemap
|
EXTENSION = pg_freespacemap
|
||||||
DATA = pg_freespacemap--1.0.sql pg_freespacemap--unpackaged--1.0.sql
|
DATA = pg_freespacemap--1.1.sql pg_freespacemap--1.0--1.1.sql \
|
||||||
|
pg_freespacemap--unpackaged--1.0.sql
|
||||||
PGFILEDESC = "pg_freespacemap - monitoring of free space map"
|
PGFILEDESC = "pg_freespacemap - monitoring of free space map"
|
||||||
|
|
||||||
ifdef USE_PGXS
|
ifdef USE_PGXS
|
||||||
|
7
contrib/pg_freespacemap/pg_freespacemap--1.0--1.1.sql
Normal file
7
contrib/pg_freespacemap/pg_freespacemap--1.0--1.1.sql
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
/* contrib/pg_freespacemap/pg_freespacemap--1.0--1.1.sql */
|
||||||
|
|
||||||
|
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
|
||||||
|
\echo Use "ALTER EXTENSION pg_freespacemap UPDATE TO '1.1'" to load this file. \quit
|
||||||
|
|
||||||
|
ALTER FUNCTION pg_freespace(regclass, bigint) PARALLEL SAFE;
|
||||||
|
ALTER FUNCTION pg_freespace(regclass) PARALLEL SAFE;
|
@ -1,4 +1,4 @@
|
|||||||
/* contrib/pg_freespacemap/pg_freespacemap--1.0.sql */
|
/* contrib/pg_freespacemap/pg_freespacemap--1.1.sql */
|
||||||
|
|
||||||
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
|
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
|
||||||
\echo Use "CREATE EXTENSION pg_freespacemap" to load this file. \quit
|
\echo Use "CREATE EXTENSION pg_freespacemap" to load this file. \quit
|
||||||
@ -7,7 +7,7 @@
|
|||||||
CREATE FUNCTION pg_freespace(regclass, bigint)
|
CREATE FUNCTION pg_freespace(regclass, bigint)
|
||||||
RETURNS int2
|
RETURNS int2
|
||||||
AS 'MODULE_PATHNAME', 'pg_freespace'
|
AS 'MODULE_PATHNAME', 'pg_freespace'
|
||||||
LANGUAGE C STRICT;
|
LANGUAGE C STRICT PARALLEL SAFE;
|
||||||
|
|
||||||
-- pg_freespace shows the recorded space avail at each block in a relation
|
-- pg_freespace shows the recorded space avail at each block in a relation
|
||||||
CREATE FUNCTION
|
CREATE FUNCTION
|
||||||
@ -17,7 +17,7 @@ AS $$
|
|||||||
SELECT blkno, pg_freespace($1, blkno) AS avail
|
SELECT blkno, pg_freespace($1, blkno) AS avail
|
||||||
FROM generate_series(0, pg_relation_size($1) / current_setting('block_size')::bigint - 1) AS blkno;
|
FROM generate_series(0, pg_relation_size($1) / current_setting('block_size')::bigint - 1) AS blkno;
|
||||||
$$
|
$$
|
||||||
LANGUAGE SQL;
|
LANGUAGE SQL PARALLEL SAFE;
|
||||||
|
|
||||||
|
|
||||||
-- Don't want these to be available to public.
|
-- Don't want these to be available to public.
|
@ -1,5 +1,5 @@
|
|||||||
# pg_freespacemap extension
|
# pg_freespacemap extension
|
||||||
comment = 'examine the free space map (FSM)'
|
comment = 'examine the free space map (FSM)'
|
||||||
default_version = '1.0'
|
default_version = '1.1'
|
||||||
module_pathname = '$libdir/pg_freespacemap'
|
module_pathname = '$libdir/pg_freespacemap'
|
||||||
relocatable = true
|
relocatable = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user