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

Unable to use wal2json plugin with the demo #54

Open
viggy28 opened this issue Apr 27, 2023 · 1 comment
Open

Unable to use wal2json plugin with the demo #54

viggy28 opened this issue Apr 27, 2023 · 1 comment

Comments

@viggy28
Copy link

viggy28 commented Apr 27, 2023

I cannot get the demo running with wal2json as the output plugin. The message format looks completely different between wal2json and pgoutput. FWIW, I tried with both the format versions of wal2json and also tried it on different PG versions.

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/viggy28/go/pkg/mod/github.com/jackc/pglogrepl@v0.0.0-20230318140337-5ef673a9d169/message.go:649 +0x2b9
main.main()
        /Users/viggy28/Sourcecontrol/github.com/viggy28/pglogrepl/main.go:136 +0xdda
@alikonhz
Copy link
Contributor

Hello @viggy28,
I'm not sure if the question is still relevant for you. But in order to use pglogrepl with wal2json you should not use pglogrepl.Parse(xld.WALData).
Instead, you should make a string from the xld.WALData (i.e. str := string(xld.WALData))
The string would contain actual output from the plugin in JSON format (e.g. {"action":"B"}, {"action":"C","origin":0}, etc.)

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

2 participants