| 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 |
CREATE OR REPLACE FUNCTION |
| 7 |
pg_freespace(rel regclass, blkno OUT bigint, 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'::bigint, pg_relation_size($1) / current_setting('block_size'::text)::bigint - '1'::bigint) AS blkno; |
| 13 |
END; |