pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Dominique Devienne <ddevienne@gmail.com>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: rob stone <floriparob@tpg.com.au>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: How to force "re-TOAST" after changing STORAGE or COMPRESSION?
Date: Tue, 3 Oct 2023 16:15:12 +0900
Message-ID: <ZRu_gO-lg_Ya1HPe@paquier.xyz> (raw)
In-Reply-To: <CAFCRh-9Fy=R9gE6oJkfnAvPqzZ1BtKZv7Qp-cAP8Ebde6KBhig@mail.gmail.com>
References: <CAFCRh-8_EFUgKSNpsyideokDo+j80iPg4GVwNoukniOjpZVnng@mail.gmail.com>
	<ZRtY5lEDPlSQuore@paquier.xyz>
	<069c100e455299d6e1aa80bda283a397fadf1926.camel@tpg.com.au>
	<f8ddee9d35553f802b5c1b1968f6c4c72a1640f1.camel@cybertec.at>
	<ZRucYsOTalCdlSzU@paquier.xyz>
	<CAFCRh-9Fy=R9gE6oJkfnAvPqzZ1BtKZv7Qp-cAP8Ebde6KBhig@mail.gmail.com>

On Tue, Oct 03, 2023 at 09:08:49AM +0200, Dominique Devienne wrote:
>  In my case, it's OK not to be transactional, for these experiments. Is
> there a way
> to lock the table and do the rewriting w/o generating any WAL? I don't have
> any experience
> with unlogged tables, but should I take an exclusive lock on the table,
> switch it to unlogged,
> rewrite, and switch it back to logged?

Switching a table back to be logged requires all its 8k blocks to be
WAL-logged, so that would be roughly the same as a plain UPDATE.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (9+ messages)  latest in thread

Message-ID: <ZRu_gO-lg_Ya1HPe@paquier.xyz>
Permalink:  ../ZRu_gO-lg_Ya1HPe@paquier.xyz/
Also on:    postgresql.org/message-id/ZRu_gO-lg_Ya1HPe@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: michael@paquier.xyz, ddevienne@gmail.com, laurenz.albe@cybertec.at, floriparob@tpg.com.au
  Subject: Re: How to force "re-TOAST" after changing STORAGE or COMPRESSION?
  In-Reply-To: <ZRu_gO-lg_Ya1HPe@paquier.xyz>
  References: <CAFCRh-8_EFUgKSNpsyideokDo+j80iPg4GVwNoukniOjpZVnng@mail.gmail.com> <ZRtY5lEDPlSQuore@paquier.xyz> <069c100e455299d6e1aa80bda283a397fadf1926.camel@tpg.com.au> <f8ddee9d35553f802b5c1b1968f6c4c72a1640f1.camel@cybertec.at> <ZRucYsOTalCdlSzU@paquier.xyz> <CAFCRh-9Fy=R9gE6oJkfnAvPqzZ1BtKZv7Qp-cAP8Ebde6KBhig@mail.gmail.com> <ZRu_gO-lg_Ya1HPe@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox