Re: WAL, xl_heap_insert and tuple oid mystry

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: jagan <jaganrvce(at)yahoo(dot)com>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WAL, xl_heap_insert and tuple oid mystry
Date: 2011-04-15 14:05:12
Message-ID: 1302876112-sup-5091@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-04-15 14:14:48 Re: Foreign table permissions and cloning
Previous Message Magnus Hagander 2011-04-15 14:02:56 Re: Windows build issues