public inbox for [email protected]  
help / color / mirror / Atom feed
Does TRUNCATE emit changes with REPLICA IDENTITY FULL?
2+ messages / 2 participants
[nested] [flat]

* Does TRUNCATE emit changes with REPLICA IDENTITY FULL?
@ 2019-11-11 09:19  PG Doc comments form <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Doc comments form @ 2019-11-11 09:19 UTC (permalink / raw)
  To: [email protected]; +Cc: [email protected]

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/11/sql-truncate.html
Description:

Hi,

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?

Kind Regards,,
m.


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Does TRUNCATE emit changes with REPLICA IDENTITY FULL?
@ 2019-11-12 00:44  Michael Paquier <[email protected]>
  parent: PG Doc comments form <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2019-11-12 00:44 UTC (permalink / raw)
  To: [email protected]; [email protected]

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


Attachments:

  [application/pgp-signature] signature.asc (833B, 2-signature.asc)
  download

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2019-11-12 00:44 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-11-11 09:19 Does TRUNCATE emit changes with REPLICA IDENTITY FULL? PG Doc comments form <[email protected]>
2019-11-12 00:44 ` Michael Paquier <[email protected]>

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