On Fri, Apr 15, 2011 at 6:29 PM, jagan <jaganr...@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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers