Allowing TRUNCATE of FK target when session_replication_role=replica

Поиск
Список
Период
Сортировка
От Hannu Krosing
Тема Allowing TRUNCATE of FK target when session_replication_role=replica
Дата
Msg-id CAMT0RQQfF3k_Ri7-zvQ2X=mt=d0Qx5qGJojk=1P8oaL6yU=+1w@mail.gmail.com
обсуждение исходный текст
Ответы Re: Allowing TRUNCATE of FK target when session_replication_role=replica  ("Euler Taveira" <euler@eulerto.com>)
Список pgsql-hackers
Hi

Currently we do not allow TRUNCATE of a table when any Foreign Keys
point to that table.

At the same time we do allow one to delete all rows when
session_replication_role=replica

This causes all kinds of pain when trying to copy in large amounts of
data, especially at the start of logical replication set-up, as many
optimisations to COPY require the table to be TRUNCATEd .

The main two are ability to FREEZE while copying and the skipping of
WAL generation in case of wal_level=minimal, both of which can achieve
significant benefits when data amounts are large.

Is there any reason to not allow TRUNCATE when
session_replication_role=replica ?

Unless there are any serious objections, I will send a patch to also
allow TRUNCATE in this case.


Best Regards
Hannu



В списке pgsql-hackers по дате отправления:

Предыдущее
От: torikoshia
Дата:
Сообщение: Re: Add new option 'all' to pg_stat_reset_shared()
Следующее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: A recent message added to pg_upgade