Re: foreign key on delete cascade order?

Поиск
Список
Период
Сортировка
От Michael Lewis
Тема Re: foreign key on delete cascade order?
Дата
Msg-id CAHOFxGrZAZPeFKdDRLxhmtTvyyfVZtq8eJB_8CWFkpSUjm7Y=w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: foreign key on delete cascade order?  (George Woodring <george.woodring@iglass.net>)
Ответы Re: foreign key on delete cascade order?  (George Woodring <george.woodring@iglass.net>)
Список pgsql-general
We are updating the entire status table every 5 minutes with
BEGIN;
UPDATE status SET () WHERE pollid = $1;
COMMIT;

The issue is arriving when some does a DELETE during the UPDATE of status
DELETE FROM mach WHERE machid=$1;

Could you set lock_timeout, lock table explicitly for SHARE UPDATE EXCLUSIVE (pretty sure that would be the proper level), then retry if it fails because a delete is already going on?

Also, are you confident that before you call 'begin' to do the update, you are not already in a transaction which might have some lock on row(s) in mach, or one of the other tables involved?

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

Предыдущее
От: Dominique Devienne
Дата:
Сообщение: Re: COPY TO STDOUT WITH (FORMAT CSV, HEADER), and embedded newlines
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Am I in the same transaction block in complex PLPGSQL?