mirror of
https://github.com/postgres/postgres.git
synced 2025-06-17 17:02:08 +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:
@ -55,6 +55,7 @@
|
||||
#include "pg_getopt.h"
|
||||
#include "postmaster/autovacuum.h"
|
||||
#include "postmaster/postmaster.h"
|
||||
#include "replication/slot.h"
|
||||
#include "replication/walsender.h"
|
||||
#include "rewrite/rewriteHandler.h"
|
||||
#include "storage/bufmgr.h"
|
||||
@ -3853,6 +3854,16 @@ PostgresMain(int argc, char *argv[],
|
||||
if (am_walsender)
|
||||
WalSndErrorCleanup();
|
||||
|
||||
/*
|
||||
* We can't release replication slots inside AbortTransaction() as we
|
||||
* need to be able to start and abort transactions while having a slot
|
||||
* acquired. But we never need to hold them across top level errors,
|
||||
* so releasing here is fine. There's another cleanup in ProcKill()
|
||||
* ensuring we'll correctly cleanup on FATAL errors as well.
|
||||
*/
|
||||
if (MyReplicationSlot != NULL)
|
||||
ReplicationSlotRelease();
|
||||
|
||||
/*
|
||||
* Now return to normal top-level context and clear ErrorContext for
|
||||
* next time.
|
||||
|
Reference in New Issue
Block a user