2006-02-12 11:55:53 +08:00
|
|
|
-- Adjust this setting to control where the objects get created.
|
|
|
|
BEGIN;
|
|
|
|
SET search_path = public;
|
|
|
|
|
2006-04-27 06:46:09 +08:00
|
|
|
|
|
|
|
-- Register the functions.
|
|
|
|
CREATE OR REPLACE FUNCTION pg_freespacemap_pages()
|
2006-02-12 11:55:53 +08:00
|
|
|
RETURNS SETOF RECORD
|
2006-04-27 06:46:09 +08:00
|
|
|
AS 'MODULE_PATHNAME', 'pg_freespacemap_pages'
|
2006-02-28 00:09:50 +08:00
|
|
|
LANGUAGE C;
|
2006-02-12 11:55:53 +08:00
|
|
|
|
2006-04-27 06:46:09 +08:00
|
|
|
CREATE OR REPLACE FUNCTION pg_freespacemap_relations()
|
|
|
|
RETURNS SETOF RECORD
|
|
|
|
AS 'MODULE_PATHNAME', 'pg_freespacemap_relations'
|
|
|
|
LANGUAGE C;
|
|
|
|
|
|
|
|
|
|
|
|
-- Create views for convenient access.
|
|
|
|
CREATE VIEW pg_freespacemap_pages AS
|
|
|
|
SELECT P.* FROM pg_freespacemap_pages() AS P
|
2006-05-05 04:39:34 +08:00
|
|
|
(reltablespace oid,
|
|
|
|
reldatabase oid,
|
|
|
|
relfilenode oid,
|
|
|
|
relblocknumber bigint,
|
|
|
|
bytes integer);
|
2006-02-12 11:55:53 +08:00
|
|
|
|
2006-04-27 06:46:09 +08:00
|
|
|
CREATE VIEW pg_freespacemap_relations AS
|
|
|
|
SELECT P.* FROM pg_freespacemap_relations() AS P
|
2006-05-05 04:39:34 +08:00
|
|
|
(reltablespace oid,
|
|
|
|
reldatabase oid,
|
|
|
|
relfilenode oid,
|
|
|
|
avgrequest integer,
|
2006-09-22 04:31:22 +08:00
|
|
|
interestingpages integer,
|
2006-05-05 04:39:34 +08:00
|
|
|
storedpages integer,
|
|
|
|
nextpage integer);
|
2006-04-27 06:46:09 +08:00
|
|
|
|
|
|
|
|
2006-05-05 04:39:34 +08:00
|
|
|
-- Don't want these to be available to public.
|
2006-04-27 06:46:09 +08:00
|
|
|
REVOKE ALL ON FUNCTION pg_freespacemap_pages() FROM PUBLIC;
|
|
|
|
REVOKE ALL ON pg_freespacemap_pages FROM PUBLIC;
|
|
|
|
|
|
|
|
REVOKE ALL ON FUNCTION pg_freespacemap_relations() FROM PUBLIC;
|
|
|
|
REVOKE ALL ON pg_freespacemap_relations FROM PUBLIC;
|
|
|
|
|
2006-02-12 11:55:53 +08:00
|
|
|
COMMIT;
|