Re: Table description in the data file (Re: pg_rawdump)

From: "Stephen R(dot) van den Berg" <srb(at)cuci(dot)nl>
To: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Subject: Re: Table description in the data file (Re: pg_rawdump)
Date: 2015-02-04 11:02:41
Message-ID: 20150204110241.GA25788@cuci.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jim Nasby wrote:
>Rather than trying to wedge this into a heap page, ISTM it'd be
>better to use a fork. Presumably if you're storing regular tuples
>that have the essential data from pg_class, pg_attribute (and maybe
>pg_type).

Well, three things:
- The information preferably is present in the same file with the
pages; ideally upfront, but reachable through a pointer within
the file is acceptable.
- The information ideally is repeated at the beginning of each
segment (separate file).
- The information can be in tuple form, but it is acceptable
(or even preferable?) to store it as a cleartext SQL CREATE
TABLE statement. Not quite sure which one I'd prefer at
this point. The tuple version might be easier to do
machine recovery with. But in any case it needs
needs database name, schema name, table name, column name,
column type, NULL constraint per column.

The reason putting it in a separate fork is not ideal, is that
when doing recovery you might not have more than just the datafiles,
and thus it is not possible to determine which fork file
belongs to which datafile (the filenames might be lost, as well
as the directory association).
--
Stephen.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen R. van den Berg 2015-02-04 11:13:52 Re: Fetch zero result rows when executing a query?
Previous Message Sam Saffron 2015-02-04 10:53:52 Re: How do I bump a row to the front of sort efficiently