| От | Tom Lane |
|---|---|
| Тема | Re: getting all constraint violations |
| Дата | |
| Msg-id | 22452.1274469022@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: getting all constraint violations ("Gauthier, Dave" <dave.gauthier@intel.com>) |
| Ответы |
Re: getting all constraint violations
|
| Список | pgsql-general |
"Gauthier, Dave" <dave.gauthier@intel.com> writes:
> Is there a way to temporarily suspend constraint checking for a particular constraint inside of the transaction, try
theinsert again, capture the next violation, then the next, etc... then rollback after all have been collected?
You could do something like
BEGIN;
ALTER TABLE DROP CONSTRAINT ...
INSERT ...
ROLLBACK;
The major deficiency of this is that the ALTER TABLE would grab
exclusive lock on the table, so this doesn't scale if you need to
have several insertions happening in parallel.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера