Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3f323eb

Browse files
committed
pg_freespacemap: Use SQL-standard function bodies
72a5b1f was the piece missing for the conversion of this module.pg_freespace is bumped to 1.3, with its function pg_freespace(regclass)converted to this new style.There are other modules in the tree that need a similar treatment; thesewill be handled later.Author: Tom LaneReviewed-by: Ronan DunklauDiscussion:https://postgr.es/m/3395418.1618352794@sss.pgh.pa.us
1 parentdb22b90 commit3f323eb

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

‎contrib/pg_freespacemap/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ OBJS = \
66
pg_freespacemap.o
77

88
EXTENSION = pg_freespacemap
9-
DATA = pg_freespacemap--1.1.sql pg_freespacemap--1.1--1.2.sql\
9+
DATA = pg_freespacemap--1.1.sql\
10+
pg_freespacemap--1.2--1.3.sql\
11+
pg_freespacemap--1.1--1.2.sql\
1012
pg_freespacemap--1.0--1.1.sql
1113
PGFILEDESC = "pg_freespacemap - monitoring of free space map"
1214

‎contrib/pg_freespacemap/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ install_data(
2020
'pg_freespacemap--1.0--1.1.sql',
2121
'pg_freespacemap--1.1--1.2.sql',
2222
'pg_freespacemap--1.1.sql',
23+
'pg_freespacemap--1.2--1.3.sql',
2324
'pg_freespacemap.control',
2425
kwargs: contrib_data_args,
2526
)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* contrib/pg_freespacemap/pg_freespacemap--1.2--1.3.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.3'" to load this file. \quit
5+
6+
CREATEOR REPLACE FUNCTION
7+
pg_freespace(rel regclass, blkno OUTbigint, avail OUT int2)
8+
RETURNS SETOF RECORD
9+
LANGUAGE SQL PARALLEL SAFE
10+
BEGIN ATOMIC
11+
SELECT blkno, pg_freespace($1, blkno)AS avail
12+
FROM generate_series(0, pg_relation_size($1)/ current_setting('block_size')::bigint-1)AS blkno;
13+
END;
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.2'
3+
default_version = '1.3'
44
module_pathname = '$libdir/pg_freespacemap'
55
relocatable = true

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp