logical decoding and replication of sequences
Started by Ranier Vilelaalmost 4 years ago1 messages
On 2/10/22 19:17, Tomas Vondra wrote:
I've polished & pushed the first part adding sequence decoding
infrastructure etc. Attached are the two remaining parts.I plan to wait a day or two and then push the test_decoding part. The
last part (for built-in replication) will need more work and maybe
rethinking the grammar etc.
I've pushed the second part, adding sequences to test_decoding.
Hi,
Minor oversight with commit 0da92dc
<https://github.com/postgres/postgres/commit/0da92dc530c9251735fc70b20cd004d9630a1266>
.
RelationIdGetRelation can return NULL, then it is necessary to check the
return.
regards,
Ranier Vilela
Attachments:
0001-avoid-dereference-null-relation.patchapplication/octet-stream; name=0001-avoid-dereference-null-relation.patchDownload
diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c
index c2d9be81fa..d03d6c5600 100644
--- a/src/backend/replication/logical/reorderbuffer.c
+++ b/src/backend/replication/logical/reorderbuffer.c
@@ -1110,6 +1110,12 @@ ReorderBufferQueueSequence(ReorderBuffer *rb, TransactionId xid,
MAIN_FORKNUM));
relation = RelationIdGetRelation(reloid);
+ if (!RelationIsValid(relation))
+ elog(ERROR, "could not open relation with OID %u (for filenode \"%s\")",
+ reloid,
+ relpathperm(rnode,
+ MAIN_FORKNUM));
+
tuple = &tuplebuf->tuple;
seq = (Form_pg_sequence_data) GETSTRUCT(tuple);