aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2019-09-19 11:01:52 +0900
committerMichael Paquier <michael@paquier.xyz>2019-09-19 11:01:52 +0900
commit58b4cb30a5bf52d71a4d0e5f9f7e1da3e64f67cc (patch)
tree94866dcd6aa67583a626306fa96169b44de1e934 /doc/src
parent59354ccef5d7671bb11982628d6ddd6fffbad2c4 (diff)
downloadpostgresql-58b4cb30a5bf52d71a4d0e5f9f7e1da3e64f67cc.tar.gz
postgresql-58b4cb30a5bf52d71a4d0e5f9f7e1da3e64f67cc.zip
Redesign pageinspect function printing infomask bits
After more discussion, the new function added by ddbd5d8 could have been designed in a better way. Based on an idea from Álvaro, instead of returning one column which includes both the raw and combined flags, use two columns, with one for the raw flags and one for the combined flags. This also takes care of some issues with HEAP_LOCKED_UPGRADED and HEAP_XMAX_IS_LOCKED_ONLY which are not really combined flags as they depend on conditions defined by other raw bits, as mentioned by Amit. While on it, fix an extra issue with combined flags. A combined flag was returned if at least one of its bits was set, but all its bits need to be set to include it in the result. Author: Michael Paquier Reviewed-by: Álvaro Herrera, Amit Kapila Discussion: https://postgr.es/m/20190913114950.GA3824@alvherre.pgsql
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/pageinspect.sgml18
1 files changed, 9 insertions, 9 deletions
diff --git a/doc/src/sgml/pageinspect.sgml b/doc/src/sgml/pageinspect.sgml
index a7da3364a1e..7e2e1487d79 100644
--- a/doc/src/sgml/pageinspect.sgml
+++ b/doc/src/sgml/pageinspect.sgml
@@ -244,7 +244,7 @@ test=# SELECT * FROM heap_page_item_attrs(get_raw_page('pg_class', 0), 'pg_class
<varlistentry>
<term>
- <function>heap_tuple_infomask_flags(t_infomask integer, t_infomask2 integer, decode_combined bool) returns text[]</function>
+ <function>heap_tuple_infomask_flags(t_infomask integer, t_infomask2 integer) returns record</function>
<indexterm>
<primary>heap_tuple_infomask_flags</primary>
</indexterm>
@@ -255,21 +255,21 @@ test=# SELECT * FROM heap_page_item_attrs(get_raw_page('pg_class', 0), 'pg_class
<structfield>t_infomask</structfield> and
<structfield>t_infomask2</structfield> returned by
<function>heap_page_items</function> into a human-readable
- array of flag names. For example:
+ set of arrays made of flag names, with one column for all
+ the flags and one column for combined flags. For example:
<screen>
-test=# SELECT t_ctid, heap_tuple_infomask_flags(t_infomask, t_infomask2) AS flags
- FROM heap_page_items(get_raw_page('pg_class', 0))
+test=# SELECT t_ctid, raw_flags, combined_flags
+ FROM heap_page_items(get_raw_page('pg_class', 0)),
+ LATERAL heap_tuple_infomask_flags(t_infomask, t_infomask2)
WHERE t_infomask IS NOT NULL OR t_infomask2 IS NOT NULL;
</screen>
This function should be called with the same arguments as the return
attributes of <function>heap_page_items</function>.
</para>
<para>
- If <parameter>decode_combined</parameter> is <literal>true</literal>,
- combined flags like <literal>HEAP_XMIN_FROZEN</literal> are
- returned instead of raw flags (<literal>HEAP_XMIN_COMMITTED</literal>
- and <literal>HEAP_XMIN_INVALID</literal> in this case). Default value
- is <literal>false</literal>.
+ Combined flags are displayed for source-level macros that take into
+ account the value of more than one raw bit, such as
+ <literal>HEAP_XMIN_FROZEN</literal>.
</para>
<para>
See <filename>src/include/access/htup_details.h</filename> for