Conversation
MacOS provides strlcpy(), no need for a private version. At some point this should be replaced with a more general test for the routine, rather than having to manually specify this based on the reported OS.
Ignore files generated by the build, as well as emacs droppings which may be generated in the course of editing.
The xlogdump package has a number of routines which come in handy when you need to parse a postgres WAL journal. This commit takes the first step in splitting useful logic out into an xlogparse library, for use by arbitrary clients, by factoring out the ReadRecord() routine. The new routine returns its state rather than just a pass/fail, allowing clients to customize their response to conditions like end-of-log, and log file switch. As part of this refactoring, took the opportunity to cull unused header inclusions from affected files.
Factored the value demarshalling logic out of printValue() and added it to the xlogparse library as DecodeValue(). Culled unused header inclusions from xlogdump_statement.c
As a library, our parsing code shouldn't assume that clients want stdout descriptions of each page as it's read. To fix this and support the traditional xlogdump model, this behavior can now be optionally enabled using the SetPageInfoDump() routine. In the future, it may make sense to take this a step further and give clients a finer grained control, like the ability to specify the output stream for both standard and error output.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm interested in parsing WAL files and processing the results programatically. Your work on the xlogdump tool provides a great platform, and this pull request factors out some of the prime logic into a stand-alone library so arbitrary clients can customize their handling on a record-by-record basis.
Please let me know if there's any changes you'd like to see before merging, or if any other information would be useful.
thanks,