| От | Dimitri Fontaine |
|---|---|
| Тема | Re: Avoid transaction abot if/when constraint violated |
| Дата | |
| Msg-id | m2d41am3ff.fsf@hi-media.com обсуждение исходный текст |
| Ответ на | Avoid transaction abot if/when constraint violated ("Gauthier, Dave" <dave.gauthier@intel.com>) |
| Список | pgsql-general |
"Gauthier, Dave" <dave.gauthier@intel.com> writes: > I have a long list of records I want to insert into a table in such a way as I can trap and report any/all constraint violationsbefore rolling back (or opting to commit). > Unfortunately, after I hit the first constraint violation, it aborts the transaction, and then reports “ERROR: currenttransaction is aborted, commands ignored until end of > transaction block”. > > Is there a way around this? Either load to another table with no constraint then use it as a source for loading the constrained one, excluding the problematic rows: INSERT INTO ... SELECT * FROM import.table LEFT JOIN ... ; Or try using pgloader once the input format is CSV like rather than INSERT. Regards, -- dim
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера