mirror of
https://github.com/postgres/postgres.git
synced 2025-07-24 14:22:24 +03:00
Introduce logical decoding.
This feature, building on previous commits, allows the write-ahead log stream to be decoded into a series of logical changes; that is, inserts, updates, and deletes and the transactions which contain them. It is capable of handling decoding even across changes to the schema of the effected tables. The output format is controlled by a so-called "output plugin"; an example is included. To make use of this in a real replication system, the output plugin will need to be modified to produce output in the format appropriate to that system, and to perform filtering. Currently, information can be extracted from the logical decoding system only via SQL; future commits will add the ability to stream changes via walsender. Andres Freund, with review and other contributions from many other people, including Álvaro Herrera, Abhijit Menon-Sen, Peter Gheogegan, Kevin Grittner, Robert Haas, Heikki Linnakangas, Fujii Masao, Abhijit Menon-Sen, Michael Paquier, Simon Riggs, Craig Ringer, and Steve Singer.
This commit is contained in:
@ -1074,8 +1074,16 @@ RecordTransactionCommit(void)
|
||||
|
||||
/*
|
||||
* Do we need the long commit record? If not, use the compact format.
|
||||
*
|
||||
* For now always use the non-compact version if wal_level=logical, so
|
||||
* we can hide commits from other databases. TODO: In the future we
|
||||
* should merge compact and non-compact commits and use a flags
|
||||
* variable to determine if it contains subxacts, relations or
|
||||
* invalidation messages, that's more extensible and degrades more
|
||||
* gracefully. Till then, it's just 20 bytes of overhead.
|
||||
*/
|
||||
if (nrels > 0 || nmsgs > 0 || RelcacheInitFileInval || forceSyncCommit)
|
||||
if (nrels > 0 || nmsgs > 0 || RelcacheInitFileInval || forceSyncCommit ||
|
||||
XLogLogicalInfoActive())
|
||||
{
|
||||
XLogRecData rdata[4];
|
||||
int lastrdata = 0;
|
||||
|
Reference in New Issue
Block a user