You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there. Thanks for putting this code out here, it's been super helpful in understanding how the logical replication works. But a couple problems/questions:
I found a problem with your example code. The last couple lines in the example look like this:
replication := pgoutput.LogicalReplication{
Subscription: "sub2",
Publication: "pub2",
WaitTimeout: time.Second * 10,
StatusTimeout: time.Second * 10,
Handler: handler,
}
I think that is because calling START REPLICATION on a slot with the pgoutput decoder type requires the pglogical extension to be present and for that publisher node to be created. It looks like pgoutput as a decoder is really only intended to be used if you're using the pglogical replication and not as a standalone decoder. I'm running on Postgres version 10.. maybe this works on an older version of postgres?
If I'm misunderstanding something I'd sure appreciate any clarification you could provide.
Thanks,
Greig Wise
The text was updated successfully, but these errors were encountered:
Hi there. Thanks for putting this code out here, it's been super helpful in understanding how the logical replication works. But a couple problems/questions:
I found a problem with your example code. The last couple lines in the example look like this:
replication := pgoutput.LogicalReplication{
Subscription: "sub2",
Publication: "pub2",
WaitTimeout: time.Second * 10,
StatusTimeout: time.Second * 10,
Handler: handler,
}
if err := replication.Start(ctx, conn); err != nil {
log.Fatal(err)
}
replication := pgoutput.NewSubscription("test_subscription", "test_provider")
if err := replication.Start(ctx, conn, handler); err != nil {
log.Fatal(err)
}
The other thing is that when I make that fix and try to call Start, I get this:
2018/10/29 15:20:12 failed to start replication: ERROR: syntax error (SQLSTATE 42601)
I think that is because calling START REPLICATION on a slot with the pgoutput decoder type requires the pglogical extension to be present and for that publisher node to be created. It looks like pgoutput as a decoder is really only intended to be used if you're using the pglogical replication and not as a standalone decoder. I'm running on Postgres version 10.. maybe this works on an older version of postgres?
If I'm misunderstanding something I'd sure appreciate any clarification you could provide.
Thanks,
Greig Wise
The text was updated successfully, but these errors were encountered: