Fix xslt_process() to ensure that it inserts a NULL terminator after the
[PostgreSQL.git] / contrib / pg_freespacemap / pg_freespacemap.sql.in
blob23e4245735455d3c0454bce9dadc733fc24c01a5
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 STRICT;
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;