Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pglogrepl_demo: how to handle with wal2json plugin output #21

Open
dungnh-bpp opened this issue Aug 28, 2021 · 2 comments
Open

pglogrepl_demo: how to handle with wal2json plugin output #21

dungnh-bpp opened this issue Aug 28, 2021 · 2 comments

Comments

@dungnh-bpp
Copy link

dungnh-bpp commented Aug 28, 2021

So my questions is:
I wanna use wal2json instead of pgoutput or test_decoding output plugin, how to determine clientXLogPos when application consume message succeess.
In your pglogrepl_demo example: you 're using clientXLogPos = xld.WALStart + pglogrepl.LSN(len(xld.WALData)) with pgoutput plugin to determixe client xlogpos, right? If I use wal2json, how to determine that?
Can you help me for this
Thanks

@ubombi
Copy link
Contributor

ubombi commented Apr 6, 2022

Using PrimaryKeepaliveMessage.

@viggy28
Copy link

viggy28 commented Apr 24, 2023

Sorry for digging into an old issue. I cannot even run it with wal2json as the output plugin in the demo example.

It panics since the pglogrepl.Message is Unknown

panic: interface conversion: interface is nil, not pglogrepl.Message 

goroutine 1 [running]:
github.com/jackc/pglogrepl.Parse({0xc0000f401e, 0xa8, 0xa8})
        /Users/visi/go/pkg/mod/github.com/jackc/pglogrepl@v0.0.0-20230318140337-5ef673a9d169/message.go:649 +0x2b9
main.main()
        /Users/visi/Sourcecontrol/github.com/viggy28/pgsavior/main.go:136 +0xdda

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants