Re: DELETE CASCADE

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: DELETE CASCADE
Дата
Msg-id CAKFQuwabcO4ikW9wh4ci2KjtREB9K_kSx1dZvpvgcfHbDfjxxA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: DELETE CASCADE  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Ответы Re: DELETE CASCADE  (David Christensen <david.christensen@crunchydata.com>)
Список pgsql-hackers
On Wednesday, June 9, 2021, Peter Eisentraut <peter.eisentraut@enterprisedb.com> wrote:

It might work, I'm just saying it needs to be thought about carefully. If you have functionality like, delete this if there is no matching record over there, you need to have the permission to check that and need to make sure it stays that way.


Which I believe the presence of an existing foreign key does quite nicely.  Thus if the executing user is the table owner (group membership usually) and a FK already exists, the conditions for the cascade are fulfilled, including locking I would think, because that FK could have been defined to just do it without all this.  We are effectively just temporarily changing that aspect of the foreign key - the behavior should be identical to on cascade delete.

 I require convincing that there is a use case that requires laxer permissions.  Especially if we can solve the whole changing of the cascade option without having to drop the foreign key.

David J.

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

Предыдущее
От: Dilip Kumar
Дата:
Сообщение: Re: Decoding speculative insert with toast leaks memory
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Fix dropped object handling in pg_event_trigger_ddl_commands