Re: unlogged tables - Mailing list pgsql-hackers

From Robert Haas
Subject Re: unlogged tables
Date
Msg-id AANLkTi=xuuALCgPbL_G9S9CB+8+yHH-SZ5oyCR944SaP@mail.gmail.com
Whole thread Raw
In response to Re: unlogged tables  (marcin mank <marcin.mank@gmail.com>)
Responses Re: unlogged tables
Re: unlogged tables
List pgsql-hackers
On Tue, Nov 16, 2010 at 5:57 PM, marcin mank <marcin.mank@gmail.com> wrote:
> Can (should ?) unlogged tables' contents survive graceful (non-crash) shutdown?

I don't think so.  To make that work, you'd need to keep track of
every backing file that might contain pages not fsync()'d to disk, and
at shutdown time you'd need to fsync() them all before shutting down.
Doing that would require an awful lot of bookkeeping for a pretty
marginal gain.  Maybe it would be useful to have:

ALTER TABLE .. READ [ONLY|WRITE];

...and preserve unlogged tables that are also read-only.  Or perhaps
something specific to unlogged tables:

ALTER TABLE .. QUIESCE;

...which would take an AccessExclusiveLock, make the table read-only,
fsync() it, and tag it for restart-survival.

But I'm happy to leave all of this until we gain some field experience
with this feature, and have a better idea what features people would
most like to see.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: marcin mank
Date:
Subject: Re: unlogged tables
Next
From: Tom Lane
Date:
Subject: Re: unlogged tables