On duplicate ignore

Поиск
Список
Период
Сортировка
От Gnanakumar
Тема On duplicate ignore
Дата
Msg-id 019901ccd5d0$f4a1cca0$dde565e0$@com
обсуждение исходный текст
Ответы Re: On duplicate ignore
Список pgsql-general
Hi,

Ours is a web-based application.  We're trying to implement ON DUPLICATE
IGNORE for one of our application table, named EMAILLIST.  After a quick
Google search, I'm finding the following "easy & convenient" single SQL
statement syntax to follow with:

INSERT INTO EMAILLIST (EMAIL)
       SELECT 'john@example.net'
       WHERE NOT EXISTS (SELECT 1 FROM EMAILLIST WHERE EMAIL =
'john@example.net');

My question is, in a single threaded INSERT, this will *definitely* work.
Since ours is a web-based application, will this work out in a concurrent
multi-threaded environment too?  In other words, will it be truly unique
when INSERT calls are concurrent?

Regards,
Gnanam



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