docs: Consolidate into new "WAL for Extensions" chapter.
authorRobert Haas
Mon, 15 Apr 2024 19:46:19 +0000 (15:46 -0400)
committerRobert Haas
Mon, 15 Apr 2024 19:57:13 +0000 (15:57 -0400)
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

doc/src/sgml/custom-rmgr.sgml
doc/src/sgml/filelist.sgml
doc/src/sgml/generic-wal.sgml
doc/src/sgml/postgres.sgml
doc/src/sgml/wal-for-extensions.sgml [new file with mode: 0644]

index 0d982292951ea5b577d2b1f33cc6553314688ad3..3032b2dc0d2dfc142a1cef138ff3240ae461a9b6 100644 (file)
@@ -1,10 +1,10 @@
 
 
-<chapter id="custom-rmgr">
+<sect1 id="custom-rmgr">
  Custom WAL Resource Managers
 
  
-  This chapter explains the interface between the core
+  This section explains the interface between the core
   PostgreSQL system and custom WAL resource
   managers, which enable extensions to integrate directly with the 
   linkend="wal">WAL.
   An extension, especially a Table Access
   Method or Index Access Method, may
   need to use WAL for recovery, replication, and/or 
-  linkend="logicaldecoding">Logical Decoding. Custom resource managers
-  are a more flexible alternative to Generic
-  WAL (which does not support logical decoding), but more complex for
-  an extension to implement.
+  linkend="logicaldecoding">Logical Decoding.
  
  
   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.
    
  
-chapter>
+sect1>
index 3fb0709f5dfc868f240aa08be9bda6d4815da9bd..38ec362d8f469867e5d9bc6b6111675868ce9c97 100644 (file)
 
 
 
+
 
 
 
index a028856d2eb5a22fcf0c2857a3089ea64f085cf6..41f97ad7dc8467c41bf8a29a6ebb3cad966a1f7a 100644 (file)
@@ -1,20 +1,12 @@
 
 
-<chapter id="generic-wal">
+<sect1 id="generic-wal">
  Generic WAL Records
 
   
    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
-   to pages in a generic way. This is useful for extensions that provide
-   custom access methods.
-  
-
-  
-   In comparison with Custom WAL Resource
-   Managers, 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.
+   to pages in a generic way.
   
 
   
     
    
   
-chapter>
+sect1>
index e9a350234e7a5fc26433613525962d33a4f9a894..ec9f90e283e5f15ac802ea4c81e88ceec12340de 100644 (file)
@@ -256,8 +256,7 @@ break is not needed in a wider output rendering.
   &geqo;
   &tableam;
   &indexam;
-  &generic-wal;
-  &custom-rmgr;
+  &wal-for-extensions;
   &indextypes;
   &storage;
   &transaction;
diff --git a/doc/src/sgml/wal-for-extensions.sgml b/doc/src/sgml/wal-for-extensions.sgml
new file mode 100644 (file)
index 0000000..4c4fb29
--- /dev/null
@@ -0,0 +1,32 @@
+
+
+
Write Ahead Logging for Extensions
+
+  
+   Certain extensions, principally extensions that implement custom access
+   methods, may need to perform write-ahead logging in order to ensure
+   crash-safety. PostgreSQL provides two ways
+   for extensions to achieve this goal.
+  
+
+  
+   First, extensions can choose to use generic
+   WAL, 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.
+  
+
+  
+   Second, extensions can choose to use a custom
+   resource manager. 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.
+  
+
+&generic-wal;
+&custom-rmgr;
+
+