mirror of https://github.com/postgres/postgres
72a5b1fc88
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; these
will be handled later.
Author: Tom Lane
Reviewed-by: Ronan Dunklau
Discussion: https://postgr.es/m/3395418.1618352794@sss.pgh.pa.us
pull/184/head
parent
db22b90024
commit
3f323eba89
@ -0,0 +1,13 @@ |
||||
/* contrib/pg_freespacemap/pg_freespacemap--1.2--1.3.sql */ |
||||
|
||||
-- complain if script is sourced in psql, rather than via ALTER EXTENSION |
||||
\echo Use "ALTER EXTENSION pg_freespacemap UPDATE TO '1.3'" to load this file. \quit |
||||
|
||||
CREATE OR REPLACE FUNCTION |
||||
pg_freespace(rel regclass, blkno OUT bigint, avail OUT int2) |
||||
RETURNS SETOF RECORD |
||||
LANGUAGE SQL PARALLEL SAFE |
||||
BEGIN ATOMIC |
||||
SELECT blkno, pg_freespace($1, blkno) AS avail |
||||
FROM generate_series(0, pg_relation_size($1) / current_setting('block_size')::bigint - 1) AS blkno; |
||||
END; |
@ -1,5 +1,5 @@ |
||||
# pg_freespacemap extension |
||||
comment = 'examine the free space map (FSM)' |
||||
default_version = '1.2' |
||||
default_version = '1.3' |
||||
module_pathname = '$libdir/pg_freespacemap' |
||||
relocatable = true |
||||
|
Loading…
Reference in new issue