[PATCH] session_replication_role = replica with TRUNCATE - Mailing list pgsql-hackers

From Marco Nenciarini
Subject [PATCH] session_replication_role = replica with TRUNCATE
Date
Msg-id ff835f71-3c6c-335e-4c7b-b9e1646cf3d7@2ndquadrant.it
Whole thread Raw
Responses Re: [PATCH] session_replication_role = replica with TRUNCATE  (Petr Jelinek <petr.jelinek@2ndquadrant.com>)
Re: [PATCH] session_replication_role = replica with TRUNCATE  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
Hi,

The current behavior of session_replication_role = replica with TRUNCATE
is not the same of with the other commands.
It does not check FKs for INSERT/UPDATE/DELETE but it does for TRUNCATE,
so one cannot execute TRUNCATE on a table when it is possible to DELETE
from table without WHERE clause.

I'm attaching a simple patch to make TRUNCATE match behavior of DELETE
for session_replication_role = replica.

Regards,
Marco

--
Marco Nenciarini - 2ndQuadrant Italy
PostgreSQL Training, Services and Support
marco.nenciarini@2ndQuadrant.it | www.2ndQuadrant.it

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Basebackups reported as idle
Next
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] taking stdbool.h into use