xlogdump enhancements

From: "Diogo Biazus" <diogob(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: xlogdump enhancements
Date: 2006-07-14 13:43:15
Message-ID: eca519a10607140643v186a1efdi48100c4ed33037a1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 - diogob(at)gmail(dot)com
Móvel Consultoria
http://www.movelinfo.com.br
http://www.postgresql.org.br

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2006-07-14 13:46:55 Re: pgsql-patches considered harmful
Previous Message Thomas Hallgren 2006-07-14 12:58:01 Re: monolithic distro