summaryrefslogtreecommitdiff
path: root/contrib/pageinspect/pageinspect.sql.in
diff options
context:
space:
mode:
authorHeikki Linnakangas2008-09-30 10:52:14 +0000
committerHeikki Linnakangas2008-09-30 10:52:14 +0000
commit15c121b3ed7eb2f290e19533e41ccca734d23574 (patch)
treeb60226d720f87b82b5b44647e3d3031081cdfb07 /contrib/pageinspect/pageinspect.sql.in
parent2dbc0ca937f8ba9c76866a99fd04866232acea95 (diff)
Rewrite the FSM. Instead of relying on a fixed-size shared memory segment, the
free space information is stored in a dedicated FSM relation fork, with each relation (except for hash indexes; they don't use FSM). This eliminates the max_fsm_relations and max_fsm_pages GUC options; remove any trace of them from the backend, initdb, and documentation. Rewrite contrib/pg_freespacemap to match the new FSM implementation. Also introduce a new variant of the get_raw_page(regclass, int4, int4) function in contrib/pageinspect that let's you to return pages from any relation fork, and a new fsm_page_contents() function to inspect the new FSM pages.
Diffstat (limited to 'contrib/pageinspect/pageinspect.sql.in')
-rw-r--r--contrib/pageinspect/pageinspect.sql.in17
1 files changed, 15 insertions, 2 deletions
diff --git a/contrib/pageinspect/pageinspect.sql.in b/contrib/pageinspect/pageinspect.sql.in
index 1af59f70f46..49fea9eb51f 100644
--- a/contrib/pageinspect/pageinspect.sql.in
+++ b/contrib/pageinspect/pageinspect.sql.in
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/contrib/pageinspect/pageinspect.sql.in,v 1.4 2007/11/13 04:24:28 momjian Exp $ */
+/* $PostgreSQL: pgsql/contrib/pageinspect/pageinspect.sql.in,v 1.5 2008/09/30 10:52:09 heikki Exp $ */
-- Adjust this setting to control where the objects get created.
SET search_path = public;
@@ -6,11 +6,16 @@ SET search_path = public;
--
-- get_raw_page()
--
-CREATE OR REPLACE FUNCTION get_raw_page(text, int4)
+CREATE OR REPLACE FUNCTION get_raw_page(text, int4, int4)
RETURNS bytea
AS 'MODULE_PATHNAME', 'get_raw_page'
LANGUAGE C STRICT;
+CREATE OR REPLACE FUNCTION get_raw_page(text, int4)
+RETURNS bytea
+AS $$ SELECT get_raw_page($1, 0, $2); $$
+LANGUAGE SQL STRICT;
+
--
-- page_header()
--
@@ -92,3 +97,11 @@ CREATE OR REPLACE FUNCTION bt_page_items(IN relname text, IN blkno int4,
RETURNS SETOF record
AS 'MODULE_PATHNAME', 'bt_page_items'
LANGUAGE C STRICT;
+
+--
+-- fsm_page_contents()
+--
+CREATE OR REPLACE FUNCTION fsm_page_contents(IN page bytea)
+RETURNS text
+AS 'MODULE_PATHNAME', 'fsm_page_contents'
+LANGUAGE C STRICT;