Re: WAL, xl_heap_insert and tuple oid mystry - Mailing list pgsql-hackers

From Greg Stark
Subject Re: WAL, xl_heap_insert and tuple oid mystry
Date
Msg-id BANLkTikiVQ0RNWcMnrr7cqSkqRdsUUR4MA@mail.gmail.com
Whole thread Raw
In response to Re: WAL, xl_heap_insert and tuple oid mystry  (jagan <jaganrvce@yahoo.com>)
List pgsql-hackers
On Fri, Apr 15, 2011 at 6:29 PM, jagan <jaganrvce@yahoo.com> wrote:
> Thanks for the pointer. I will try that route of recreating tuple
> descriptors and using heap_deform_tuple, although I suspect that "heap_deform_tuple"
> cannot be used by a stand-alone application (as it is not externally visible).
> So, I will have to basically rewrite parts of it.
> I am hoping to build something that is robust that makes use of as much
> of the existing unpacking code as possible. Any additional
> pointers you can give me would be much appreciated.
>

heap_deform_tuple isn't very complex itself, and doesn't have any
external dependencies aside from the macros in postgres.h. However it
*does* depend on having a tuple descriptor. This is the data structure
which says what columns to expect and what types they are. You
actually only need to know their sizes and whether they're variable
size, but that in the server that comes from their type.

The difficulty doing this from wal is that there's nowhere to get this
information. If you get it from the live database the structure may
not match the structure that was in place at the time the WAL was
written.

-- 
greg


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: Single client performance on trivial SELECTs
Next
From: Greg Smith
Date:
Subject: Re: MMAP Buffers