I'm working on Tom's xlogdump tool to add some functionality.
IMHO some useful improvements would be and an idea of implementation:
- have an options to output only the transactions with their status and some aggregate data (transaction size).
When the user pass a -t parameter, instead of printing echa record info the program uses a linked list to acumulate the total length and status info about each xid. The status begin with NOT COMMITED, it can change to COMMITED or ABORTED. If the user pass all the files in the pg_xlog directory as parameters he knows the current status of each transaction.
- Find loser transactions (not commited to the end of the log)
I though of doing this for the only transactions option (see above).
- Have a filter to get a specifid rmid
There's always grep, but for windows users it might be interesting to filter records by rmid. There can be a flag like -r (from rmname), or -o (operation) where the user can pass a parameter like: xact, heap, etc...
And then filter the output records.
- Option to translate OIDs to names given a database connection
I receive parameters to open a connection (the usual -h, -p and -U). In the startup I try to open a connection. If the user passes the parameters of the connection the application automaticaly enter in the translate oids mode. Then each data returning function tries to get from the connected database the objects name.
- Extract the exact SQL statement in cases of xlog generated by insert/update/delete.
This is the one where I need help from you the most. I'm not certain of how to implement. But as I can see, I'll need to get object's structure from the system catalog to decode the statement. So this option will be available only if you have a connection to the database. Is this right?
I'd like to have opinions on the subject. If somebody could give me some advice on how to start the last feature (decode the statemets) I'd apreciate very much.
--
Diogo Biazus -
[EMAIL PROTECTED]
Móvel Consultoria
http://www.movelinfo.com.br
http://www.postgresql.org.br
- [HACKERS] xlogdump enhancements Diogo Biazus
- Re: [HACKERS] xlogdump enhancements Martijn van Oosterhout
- Re: [HACKERS] xlogdump enhancements Jonah H. Harris
- Re: [HACKERS] xlogdump enhancements Diogo Biazus