Re: Duplicate key insert question
От | Jean-Christian Imbeault |
---|---|
Тема | Re: Duplicate key insert question |
Дата | |
Msg-id | 3F02340A.9050205@mega-bucks.co.jp обсуждение исходный текст |
Ответ на | Duplicate key insert question (Jean-Christian Imbeault <jc@mega-bucks.co.jp>) |
Список | pgsql-general |
Alvaro Herrera wrote: > > The thread is here: > http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=3A4D6116.1A613402%40mascari.com&rnum=1&prev=/groups%3Fq%3DMike%2BMascari%2BINSERT%2BNOT%2BEXISTS%26ie%3D Thanks! > The solution is not correct in that there _is_ a race condition. I thought so :( >>No, what I want if to have one query that will *always* insert if there >>is no record with this primary key and *always* do nothing (not fail, >>not generate an error) if there is already a record with this primary >>key. I don't want to check return values :) > > > No way. I was beginning to think so. Thanks for confirming my suspicions. In your opinion what is the best solution, if we define best as not generating any error messages and executing as quickly as possible? Thanks, Jean-Christian Imbeault
В списке pgsql-general по дате отправления: