Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id D908A2E00DB for ; Mon, 7 Jan 2008 10:22:34 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 78003-08 for ; Mon, 7 Jan 2008 10:22:18 -0400 (AST) Received: from mail.fmed.uba.ar (mail.fmed.uba.ar [157.92.152.1]) by postgresql.org (Postfix) with ESMTP id 273612E2EE3 for ; Mon, 7 Jan 2008 10:22:18 -0400 (AST) Received: from [157.92.155.58] (mailbis [157.92.155.58]) by mail.fmed.uba.ar (Postfix) with ESMTP id 63A6811D2F8 for ; Mon, 7 Jan 2008 12:22:14 -0200 (ARST) Message-ID: <47823681.3060102@fmed.uba.ar> Date: Mon, 07 Jan 2008 11:26:09 -0300 From: Gerardo Herzig User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: reading WAL files in python References: <478226FB.6030306@fmed.uba.ar> <1199714728.11354.309.camel@chaos> In-Reply-To: <1199714728.11354.309.camel@chaos> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/24 X-Sequence-Number: 29878 C. Bergström wrote: >On Mon, 2008-01-07 at 10:19 -0300, Gerardo Herzig wrote: > > >>Hi all. Im having some fun trying to write my own replication system >>using python. I will use the postgres own WAL archiving to write the >>files, then my app will read them and do some stuff. As im not a C >>programmer, im stuck in the mission of reading the binary files. >> >>I guess im needing to know the internals of how wals archives are, how >>big the buffer has to be, in order to have a complete sql command. >> >>Can someone point some advice? >>I was trying to understad src/backend/access/transam/xlog.c, but seems >>too difficult to me :( >> >> >> > >imho you can save yourself a lot of time by taking a look at skytools[1] >as it may be more along the lines of what you're trying to accomplish >anyway. > >Cheers, > >./C > >[1] https://developer.skype.com/SkypeGarage/DbProjects/SkyTools > > > > Oh yes, you already told me about skytools. But im also trying to learn more about postgres and python, and this seems to a great oportunity to do that. I dont mind if im reinventing the wheel, i usually have fun doing it. Thanks! Gerardo