mirror of
https://github.com/postgres/postgres.git
synced 2025-04-29 13:56:47 +03:00
docs: Consolidate into new "WAL for Extensions" chapter.
Previously, we had consecutive, very short chapters called "Generic WAL" and "Custom WAL Resource Managers," explaining different approaches to the same problem. Merge them into a single chapter. Explain most of the differences between the approaches in the chapter's introductory text, rather than in the individual sections. Discussion: http://postgr.es/m/46ac50c1-6b2a-404f-a683-b67af6ab56e9@eisentraut.org
This commit is contained in:
parent
953cf49e16
commit
09d9800e52
@ -1,10 +1,10 @@
|
|||||||
<!-- doc/src/sgml/custom-rmgr.sgml -->
|
<!-- doc/src/sgml/custom-rmgr.sgml -->
|
||||||
|
|
||||||
<chapter id="custom-rmgr">
|
<sect1 id="custom-rmgr">
|
||||||
<title>Custom WAL Resource Managers</title>
|
<title>Custom WAL Resource Managers</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
This chapter explains the interface between the core
|
This section explains the interface between the core
|
||||||
<productname>PostgreSQL</productname> system and custom WAL resource
|
<productname>PostgreSQL</productname> system and custom WAL resource
|
||||||
managers, which enable extensions to integrate directly with the <link
|
managers, which enable extensions to integrate directly with the <link
|
||||||
linkend="wal"><acronym>WAL</acronym></link>.
|
linkend="wal"><acronym>WAL</acronym></link>.
|
||||||
@ -13,10 +13,7 @@
|
|||||||
An extension, especially a <link linkend="tableam">Table Access
|
An extension, especially a <link linkend="tableam">Table Access
|
||||||
Method</link> or <link linkend="indexam">Index Access Method</link>, may
|
Method</link> or <link linkend="indexam">Index Access Method</link>, may
|
||||||
need to use WAL for recovery, replication, and/or <link
|
need to use WAL for recovery, replication, and/or <link
|
||||||
linkend="logicaldecoding">Logical Decoding</link>. Custom resource managers
|
linkend="logicaldecoding">Logical Decoding</link>.
|
||||||
are a more flexible alternative to <link linkend="generic-wal">Generic
|
|
||||||
WAL</link> (which does not support logical decoding), but more complex for
|
|
||||||
an extension to implement.
|
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
To create a new custom WAL resource manager, first define an
|
To create a new custom WAL resource manager, first define an
|
||||||
@ -102,4 +99,4 @@ extern void RegisterCustomRmgr(RmgrId rmid, const RmgrData *rmgr);
|
|||||||
the custom WAL records, which may prevent the server from starting.
|
the custom WAL records, which may prevent the server from starting.
|
||||||
</para>
|
</para>
|
||||||
</note>
|
</note>
|
||||||
</chapter>
|
</sect1>
|
||||||
|
@ -107,6 +107,7 @@
|
|||||||
<!ENTITY storage SYSTEM "storage.sgml">
|
<!ENTITY storage SYSTEM "storage.sgml">
|
||||||
<!ENTITY transaction SYSTEM "xact.sgml">
|
<!ENTITY transaction SYSTEM "xact.sgml">
|
||||||
<!ENTITY tablesample-method SYSTEM "tablesample-method.sgml">
|
<!ENTITY tablesample-method SYSTEM "tablesample-method.sgml">
|
||||||
|
<!ENTITY wal-for-extensions SYSTEM "wal-for-extensions.sgml">
|
||||||
<!ENTITY generic-wal SYSTEM "generic-wal.sgml">
|
<!ENTITY generic-wal SYSTEM "generic-wal.sgml">
|
||||||
<!ENTITY custom-rmgr SYSTEM "custom-rmgr.sgml">
|
<!ENTITY custom-rmgr SYSTEM "custom-rmgr.sgml">
|
||||||
<!ENTITY backup-manifest SYSTEM "backup-manifest.sgml">
|
<!ENTITY backup-manifest SYSTEM "backup-manifest.sgml">
|
||||||
|
@ -1,20 +1,12 @@
|
|||||||
<!-- doc/src/sgml/generic-wal.sgml -->
|
<!-- doc/src/sgml/generic-wal.sgml -->
|
||||||
|
|
||||||
<chapter id="generic-wal">
|
<sect1 id="generic-wal">
|
||||||
<title>Generic WAL Records</title>
|
<title>Generic WAL Records</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Although all built-in WAL-logged modules have their own types of WAL
|
Although all built-in WAL-logged modules have their own types of WAL
|
||||||
records, there is also a generic WAL record type, which describes changes
|
records, there is also a generic WAL record type, which describes changes
|
||||||
to pages in a generic way. This is useful for extensions that provide
|
to pages in a generic way.
|
||||||
custom access methods.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
In comparison with <link linkend="custom-rmgr">Custom WAL Resource
|
|
||||||
Managers</link>, Generic WAL is simpler for an extension to implement and
|
|
||||||
does not require the extension library to be loaded in order to apply the
|
|
||||||
records.
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<note>
|
<note>
|
||||||
@ -171,4 +163,4 @@
|
|||||||
</listitem>
|
</listitem>
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
</para>
|
</para>
|
||||||
</chapter>
|
</sect1>
|
||||||
|
@ -256,8 +256,7 @@ break is not needed in a wider output rendering.
|
|||||||
&geqo;
|
&geqo;
|
||||||
&tableam;
|
&tableam;
|
||||||
&indexam;
|
&indexam;
|
||||||
&generic-wal;
|
&wal-for-extensions;
|
||||||
&custom-rmgr;
|
|
||||||
&indextypes;
|
&indextypes;
|
||||||
&storage;
|
&storage;
|
||||||
&transaction;
|
&transaction;
|
||||||
|
32
doc/src/sgml/wal-for-extensions.sgml
Normal file
32
doc/src/sgml/wal-for-extensions.sgml
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<!-- doc/src/sgml/wal-for-extensions.sgml -->
|
||||||
|
|
||||||
|
<chapter id="wal-for-extensions">
|
||||||
|
<title>Write Ahead Logging for Extensions</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Certain extensions, principally extensions that implement custom access
|
||||||
|
methods, may need to perform write-ahead logging in order to ensure
|
||||||
|
crash-safety. <productname>PostgreSQL</productname> provides two ways
|
||||||
|
for extensions to achieve this goal.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
First, extensions can choose to use <link linkend="generic-wal">generic
|
||||||
|
WAL</link>, a special type of WAL record which describes changes to pages
|
||||||
|
in a generic way. This method is simple to implement and does not require
|
||||||
|
that an extension library be loaded in order to apply the records. However,
|
||||||
|
generic WAL records will be ignored when performing logical decoding.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Second, extensions can choose to use a <link linkend="custom-rmgr">custom
|
||||||
|
resource manager</link>. This method is more flexible, supports logical
|
||||||
|
decoding, and can sometimes generate much smaller write-ahead log records
|
||||||
|
than would be possible with generic WAL. However, it is more complex for an
|
||||||
|
extension to implement.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
&generic-wal;
|
||||||
|
&custom-rmgr;
|
||||||
|
|
||||||
|
</chapter>
|
Loading…
x
Reference in New Issue
Block a user