Re: Catching unique_violation exception on specific column/index
От
Thomas Kellerer
Тема
Re: Catching unique_violation exception on specific column/index
Дата
Msg-id
6ccb6712-33bb-2f42-c16f-378a337160b6@gmx.net
Ответ на
Re: Catching unique_violation exception on specific column/index (Alexey Dokuchaev)
Список
Дерево обсуждения
Catching unique_violation exception on specific column/index Alexey Dokuchaev <danfe@nsu.ru>
Re: Catching unique_violation exception on specific column/index Thomas Kellerer <spam_eater@gmx.net>
Re: Catching unique_violation exception on specific column/index Alexey Dokuchaev <danfe@nsu.ru>
Re: Catching unique_violation exception on specific column/index Andreas Kretschmer <andreas@a-kretschmer.de>
Re: Catching unique_violation exception on specific column/index Thomas Kellerer <spam_eater@gmx.net>
Re: Catching unique_violation exception on specific column/index Alexey Dokuchaev <danfe@nsu.ru>
Re: Catching unique_violation exception on specific column/index Adrian Klaver <adrian.klaver@aklaver.com>
Re: Catching unique_violation exception on specific column/index Alexey Dokuchaev <danfe@nsu.ru>
Alexey Dokuchaev schrieb am 11.06.2018 um 12:58: >>> I have a table with several UNIQUE and CHECK constraints. One of these >>> UNIQUE constraints actually *can* be violated -- not on the table level, >>> of course, but on the application level -- meaning, if the entry with >>> particular foo_key is already in there, do not throw an exception, just >>> silently do nothing. >> >> What's wrong with: >> >> INSERT ... >> ON CONFLICT (foo_key) DO NOTHING > > Nothing I guess, except that it is available since 9.5 (right?), and I try > to stay compatible with 9.3. Sorry for not saying this in the first place. Andreas already mentioned that 9.3 will be EOL soon (3 months from now), but the performance and efficiency for concurrent execution of ON CONFLICT is much better than anything you can implement yourself. If that functionality is an important part of your code, you should consider upgrading to 10 (or 9.6 if your are really conservative) rather sooner than later.
В списке pgsql-general по дате отправления
От: Alexey Dokuchaev
Дата: