Prevent accidental whole-table DELETEs and UPDATEs

Поиск
Список
Период
Сортировка
От Nikolay Samokhvalov
Тема Prevent accidental whole-table DELETEs and UPDATEs
Дата
Msg-id CANNMO++s0ayutEaM8qu+MDzPOAvWnc8uJSfBSWCRh+MKZoBjNw@mail.gmail.com
обсуждение исходный текст
Ответы Re: Prevent accidental whole-table DELETEs and UPDATEs  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
In many cases, a DELETE or UPDATE not having a WHERE clause (or having it with a condition matching all rows in the table) is a sign of some kind of mistake, leading to accidental data loss, performance issues, producing a lot of dead tuples, and so on. Recently, this topic was again discussed [1]

Attached is a patch implemented by Andrey Boroding (attached) during our today's online session [2], containing a rough prototype for two new GUCs:

- prevent_unqualified_deletes
- prevent_unqualified_updates

Both are "false" by default; for superusers, they are not applied.

There is also another implementation of this idea, in the form of an extension [3], but I think having this in the core would be beneficial to many users.

Looking forward to your feedback.

Вложения

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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: Amcheck verification of GiST and GIN
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: run pgindent on a regular basis / scripted manner