From: gherzig@fmed.uba.ar
To: pgsql-sql@postgresql.org
Subject: Re: reading WAL files in python
Date: Mon, 7 Jan 2008 18:47:09 -0200 (ARST)
Message-ID: <2855.190.55.98.232.1199738829.squirrel@www.webmail.fmed.uba.ar> (raw)
In-Reply-To: <CE398E79-FFEF-4219-9606-F5D28AD2E665@myemma.com>
References: <478226FB.6030306@fmed.uba.ar>
<CE398E79-FFEF-4219-9606-F5D28AD2E665@myemma.com>
>
> On Jan 7, 2008, at 7:19 AM, 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 :(
>
> The biggest problem with what you're wanting to do here is that the
> data written to the WALL archives isn't going to be at all easily
> translatable into SQL statements. AFAIK, the WAL data records on-
> disk file changes, i.e. it's strictly a binary mode scenario. As
> someone has already suggested, if you want to learn more about
> Postgres and Python, look at Skytools. I'm not just saying to use
> it, read the code and, if you like, offer help with patches.
>
> Erik Jones
So the fun ends in 3, 2, 1....
Well, so it looks like the trigger approach is now my path to follow.
Yeah, im looking for skytools code, looks very nice, maybe a little
outdate (just a quick look, it uses old-style python classes).
BTW, the information about WAL system you gave me, just saves me a lot of
time. Thanks you for that!
Gerardo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: gherzig@fmed.uba.ar
Subject: Re: reading WAL files in python
In-Reply-To: <2855.190.55.98.232.1199738829.squirrel@www.webmail.fmed.uba.ar>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox