Re: read-only UNLOGGED tables - Mailing list pgsql-general

From Leonardo Francalanci
Subject Re: read-only UNLOGGED tables
Date
Msg-id 782924.22118.qm@web29020.mail.ird.yahoo.com
Whole thread Raw
In response to Re: read-only UNLOGGED tables  (Gianni Ciolli <gianni.ciolli@2ndquadrant.it>)
Responses Re: read-only UNLOGGED tables  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-general
> I suppose that a similar effect could be achieved by something  like
>
>   CREATE TABLE mytable_logged AS
>   SELECT * FROM  mytable_unlogged;
>
> which would not produce WAL:


yes, but it would mean re-writing the whole data + re-creating the indexes.

I didn't know that some statements don't write WAL at all if wal_level is
minimal (they just fsync at the end). Couldn't that be done in the
UNLOGGED to "regular" case? That is: if wal_level is minimal, you can
transform an unlogged table into a logged one, without having to rewrite
data + indexes: "just" fsync it and be done with it.

Wouldn't that be useful?


Leonardo




pgsql-general by date:

Previous
From: Julia Jacobson
Date:
Subject: Re: Linking against static libpq using Visual C++
Next
From: Simon Riggs
Date:
Subject: Re: read-only UNLOGGED tables