Skip to content

Commit 292ae8a

Browse files
committed
Improve documentation of pageinspect
This adds a section for heap-related functions. These were previously mixed with functions having a more general purpose, leading to confusion. While on it, add a query example for fsm_page_contents. Backpatch down to 10, where b5e3942 introduced the subsections for function types in pageinspect documentation. Author: Masahiko Sawada Discussion: https://postgr.es/m/CAD21AoDyM7E1+cK3-aWejxKTGC-wVVP2B+RnJhN6inXyeRmqzw@mail.gmail.com Backpatch-through: 10
1 parent 21e60fa commit 292ae8a

File tree

1 file changed

+33
-23
lines changed

1 file changed

+33
-23
lines changed

doc/src/sgml/pageinspect.sgml

+33-23
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,39 @@ test=# SELECT page_checksum(get_raw_page('pg_class', 0), 0);
125125
</listitem>
126126
</varlistentry>
127127

128+
<varlistentry>
129+
<term>
130+
<function>fsm_page_contents(page bytea) returns text</function>
131+
<indexterm>
132+
<primary>fsm_page_contents</primary>
133+
</indexterm>
134+
</term>
135+
136+
<listitem>
137+
<para>
138+
<function>fsm_page_contents</function> shows the internal node structure
139+
of a FSM page. For example:
140+
<screen>
141+
test=# SELECT fsm_page_contents(get_raw_page('pg_class', 'fsm', 0));
142+
</screen>
143+
The output is a multiline string, with one line per node in the binary
144+
tree within the page. Only those nodes that are not zero are printed.
145+
The so-called "next" pointer, which points to the next slot to be
146+
returned from the page, is also printed.
147+
</para>
148+
<para>
149+
See <filename>src/backend/storage/freespace/README</filename> for more
150+
information on the structure of an FSM page.
151+
</para>
152+
</listitem>
153+
</varlistentry>
154+
</variablelist>
155+
</sect2>
156+
157+
<sect2>
158+
<title>Heap Functions</title>
159+
160+
<variablelist>
128161
<varlistentry>
129162
<term>
130163
<function>heap_page_items(page bytea) returns setof record</function>
@@ -203,29 +236,6 @@ test=# SELECT * FROM heap_page_item_attrs(get_raw_page('pg_class', 0), 'pg_class
203236
</para>
204237
</listitem>
205238
</varlistentry>
206-
207-
<varlistentry>
208-
<term>
209-
<function>fsm_page_contents(page bytea) returns text</function>
210-
<indexterm>
211-
<primary>fsm_page_contents</primary>
212-
</indexterm>
213-
</term>
214-
215-
<listitem>
216-
<para>
217-
<function>fsm_page_contents</function> shows the internal node structure
218-
of a FSM page. The output is a multiline string, with one line per
219-
node in the binary tree within the page. Only those nodes that are not
220-
zero are printed. The so-called "next" pointer, which points to the
221-
next slot to be returned from the page, is also printed.
222-
</para>
223-
<para>
224-
See <filename>src/backend/storage/freespace/README</filename> for more
225-
information on the structure of an FSM page.
226-
</para>
227-
</listitem>
228-
</varlistentry>
229239
</variablelist>
230240
</sect2>
231241

0 commit comments

Comments
 (0)