Re: pg_rawdump

From: Greg Stark <gsstark(at)mit(dot)edu>
To: "Stephen R(dot) van den Berg" <srb(at)cuci(dot)nl>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Aidan Van Dyk <aidan(at)highrise(dot)ca>, Roberto Mello <roberto(dot)mello(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_rawdump
Date: 2010-10-21 20:03:07
Message-ID: AANLkTimFBtaxZoygEd5g1iN-87W4arz0vw7Ev4wyQEAB@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 21, 2010 at 11:30 AM, Stephen R. van den Berg <srb(at)cuci(dot)nl> wrote:
> For the recovery information I'd like to reserve:
> identifier: 00: table OID
>            01: table layout
>

So here's a proposal for something that could maybe be implemented. I
think I'm leaning against this currently as there are just too many
caveats even for this limited functionality. I'm more inclined to go
with the idea someone else proposed of dumping an audit log of all DDL
on the table or after any DDL dumping the create table statements as
pg_dump would generate them would to a separate fork.

But here goes just to give you an idea what I think is doable and how
limited it would be:

In this meta data object put:

table oid
table name
number of columns
array of typlen for those columns (-1 for varlena and size for fixed length)

That would have a maximum size of just over 6k which is too large for
a BUFSZ 4k database but fits on default 8k databases. It would have
enough information to be able to find all the table columns but not to
understand how to interpret the contents either what their name or
types.

Including the type brings in a new set of complications. Even if you
assume the built-in typoids never change there are going to be typoids
that correspond to user defined types. Without the names of those
types the oids are pretty useless.

Just the typoids would put you over 8k in the worst case and the names
would put you into the realm of needing arbitrary numbers of blocks
for even average cases. Simiarly including the column names would
require potentially many blocks.

--
greg

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-10-21 20:10:43 Re: Exposing an installation's default value of unix_socket_directory
Previous Message Dimitri Fontaine 2010-10-21 19:46:25 Re: Exposing an installation's default value of unix_socket_directory