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

From Alvaro Herrera
Subject Re: WAL, xl_heap_insert and tuple oid mystry
Date
Msg-id 1302876112-sup-5091@alvh.no-ip.org
Whole thread Raw
In response to Re: WAL, xl_heap_insert and tuple oid mystry  (jagan <jaganrvce@yahoo.com>)
Responses Re: WAL, xl_heap_insert and tuple oid mystry  (jagan <jaganrvce@yahoo.com>)
List pgsql-hackers
Excerpts from jagan's message of jue abr 14 17:30:17 -0300 2011:

> In general, what is the best way to unpack buffers containing tuples?
> I came across "heap_form_tuple" but not sure if that is most optimal
> way to go about. Is there some documentation on how tuples are
> internally stored? 

Unpack buffers containing tuples?  You don't do that.  If you have a
page that comes from a table, you grab the tuple offset from the line
pointer, and start decoding there (probably heap_deform_tuple is what
you need; note you need a tuple descriptor).  If you have something that
comes from a WAL record, I don't think that's considered unpackable
directly -- you have to copy it elsewhere first.  I might be wrong about
this though.

What is the use case for this tool you're writing?

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Windows build issues
Next
From: Robert Haas
Date:
Subject: Re: Foreign table permissions and cloning