Re: Atomar SQL Statement

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Atomar SQL Statement
Дата
Msg-id 20060707105847.J77811@megazone.bigpanda.com
обсуждение исходный текст
Ответ на Re: Atomar SQL Statement  (Michael Glaesemann <grzm@seespotcode.net>)
Ответы Re: Atomar SQL Statement
Re: Atomar SQL Statement
Список pgsql-sql
On Fri, 7 Jul 2006, Michael Glaesemann wrote:

>
> On Jul 7, 2006, at 7:55 , Weber, Johann (ISS Kassel) wrote:
>
> > My concern: in a multi threaded environment, can a second thread
> > interrupt this statement and eventually insert the same email
> > address in
> > the table with a different id? Or is this statement atomar?
>
> You're safe. Take a look at the FAQ entries on SERIAL:
>
> http://www.postgresql.org/docs/faqs.FAQ.html#item4.11.2

I don't think he is, because I don't think the issue is the SERIAL
behavior, but instead the NOT EXISTS behavior.  Won't the NOT EXISTS in
read committed potentially be true for both concurrent sessions if the
second happens before the first commits, which then would mean that both
sessions will go on to attempt the insert (with their own respective ids
from the serial)? Without a unique constraint on email I think he can end
up with the same email address with two different ids.




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

Предыдущее
От: "Forums @ Existanze"
Дата:
Сообщение: Custom Data Type Mapping JDBC
Следующее
От: "Rodrigo De Leon"
Дата:
Сообщение: Re: SELECT substring with regex