Skip to content

Commit 42d4257

Browse files
committed
Update pg_freespacemap extension for parallel query.
All functions provided by this extension are PARALLEL SAFE. Andreas Karlsson
1 parent 0dbf3ce commit 42d4257

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

contrib/pg_freespacemap/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ MODULE_big = pg_freespacemap
44
OBJS = pg_freespacemap.o $(WIN32RES)
55

66
EXTENSION = pg_freespacemap
7-
DATA = pg_freespacemap--1.0.sql pg_freespacemap--unpackaged--1.0.sql
7+
DATA = pg_freespacemap--1.1.sql pg_freespacemap--1.0--1.1.sql \
8+
pg_freespacemap--unpackaged--1.0.sql
89
PGFILEDESC = "pg_freespacemap - monitoring of free space map"
910

1011
ifdef USE_PGXS
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* contrib/pg_freespacemap/pg_freespacemap--1.0--1.1.sql */
2+
3+
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
4+
\echo Use "ALTER EXTENSION pg_freespacemap UPDATE TO '1.1'" to load this file. \quit
5+
6+
ALTER FUNCTION pg_freespace(regclass, bigint) PARALLEL SAFE;
7+
ALTER FUNCTION pg_freespace(regclass) PARALLEL SAFE;

contrib/pg_freespacemap/pg_freespacemap--1.0.sql renamed to contrib/pg_freespacemap/pg_freespacemap--1.1.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* contrib/pg_freespacemap/pg_freespacemap--1.0.sql */
1+
/* contrib/pg_freespacemap/pg_freespacemap--1.1.sql */
22

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

1212
-- pg_freespace shows the recorded space avail at each block in a relation
1313
CREATE FUNCTION
@@ -17,7 +17,7 @@ AS $$
1717
SELECT blkno, pg_freespace($1, blkno) AS avail
1818
FROM generate_series(0, pg_relation_size($1) / current_setting('block_size')::bigint - 1) AS blkno;
1919
$$
20-
LANGUAGE SQL;
20+
LANGUAGE SQL PARALLEL SAFE;
2121

2222

2323
-- Don't want these to be available to public.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# pg_freespacemap extension
22
comment = 'examine the free space map (FSM)'
3-
default_version = '1.0'
3+
default_version = '1.1'
44
module_pathname = '$libdir/pg_freespacemap'
55
relocatable = true

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy