Re: Does TRUNCATE emit changes with REPLICA IDENTITY FULL?

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: analytik(at)uglycode(dot)com, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: Does TRUNCATE emit changes with REPLICA IDENTITY FULL?
Date: 2019-11-12 00:44:32
Message-ID: 20191112004432.GB1549@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Mon, Nov 11, 2019 at 09:19:52AM +0000, PG Doc comments form wrote:
> The documentation says that TRUNCATE ignores ON DELETE triggers, but it
> doesn't explicitly mention what happens if we use `wal_level = logical` and
> `REPLICA IDENTITY FULL`. Does TRUNCATE emit changes for each row and clog
> the WAL, or will it still be blazing fast?

Truncate does not issue per-row changes with a full replica identity
in this context. It roughly just takes an exclusive lock on the
table, then physically removes all the files related to the table.
--
Michael

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Bruce Momjian 2019-11-13 03:04:59 Re: Does 'instead of delete' trigger support modification of OLD
Previous Message Liudmila Mantrova 2019-11-11 16:00:22 Re: Does 'instead of delete' trigger support modification of OLD