managers, which enable extensions to integrate directly with the
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
the custom WAL records, which may prevent the server from starting.
-chapter >
+sect1 >
-<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 >
&geqo;
&tableam;
&indexam;
- &generic-wal;
- &custom-rmgr;
+ &wal-for-extensions;
&indextypes;
&storage;
&transaction;
--- /dev/null
+
+
+
+
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;
+
+