Start background writer during archive recovery. Background writer now performs
[PostgreSQL.git] / contrib / pg_freespacemap / pg_freespacemap.sql.in
blob5c67d8c90f547f682c3d78a77266d81378d3b8ef
1 /* $PostgreSQL$ */
3 -- Adjust this setting to control where the objects get created.
4 SET search_path = public;
7 -- Register the C function.
8 CREATE OR REPLACE FUNCTION pg_freespace(regclass, bigint)
9 RETURNS int2
10 AS 'MODULE_PATHNAME', 'pg_freespace'
11 LANGUAGE C;
13 -- pg_freespace shows the recorded space avail at each block in a relation
14 CREATE OR REPLACE FUNCTION
15 pg_freespace(rel regclass, blkno OUT bigint, avail OUT int2)
16 RETURNS SETOF RECORD
17 AS $$
18 SELECT blkno, pg_freespace($1, blkno) AS avail
19 FROM generate_series(0, pg_relation_size($1) / current_setting('block_size')::bigint - 1) AS blkno;
21 LANGUAGE SQL;
24 -- Don't want these to be available to public.
25 REVOKE ALL ON FUNCTION pg_freespace(regclass, bigint) FROM PUBLIC;
26 REVOKE ALL ON FUNCTION pg_freespace(regclass) FROM PUBLIC;