Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 4055D2E00DB for ; Mon, 7 Jan 2008 10:10:01 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 17576-01 for ; Mon, 7 Jan 2008 10:09:49 -0400 (AST) Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.190]) by postgresql.org (Postfix) with ESMTP id E8A362E2F64 for ; Mon, 7 Jan 2008 10:09:54 -0400 (AST) Received: by fk-out-0910.google.com with SMTP id b27so9828719fka.3 for ; Mon, 07 Jan 2008 06:09:52 -0800 (PST) Received: by 10.82.158.12 with SMTP id g12mr9034092bue.18.1199714990143; Mon, 07 Jan 2008 06:09:50 -0800 (PST) Received: from ?192.168.1.65? ( [84.81.213.205]) by mx.google.com with ESMTPS id f13sm9853555gvd.18.2008.01.07.06.09.47 (version=SSLv3 cipher=RC4-MD5); Mon, 07 Jan 2008 06:09:47 -0800 (PST) Subject: Re: reading WAL files in python From: "C." =?ISO-8859-1?Q?Bergstr=F6m?= To: pgsql-sql@postgresql.org In-Reply-To: <478226FB.6030306@fmed.uba.ar> References: <478226FB.6030306@fmed.uba.ar> Content-Type: text/plain Date: Mon, 07 Jan 2008 15:05:28 +0100 Message-Id: <1199714728.11354.309.camel@chaos> Mime-Version: 1.0 X-Mailer: Evolution 2.12.2 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/23 X-Sequence-Number: 29877 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