Re: Simple SQL INSERT to avoid duplication failed: why?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Simple SQL INSERT to avoid duplication failed: why?
Дата
Msg-id 14798.1367363492@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Simple SQL INSERT to avoid duplication failed: why?  ("Carlo Stonebanks" <stonec.register@sympatico.ca>)
Список pgsql-general
"Carlo Stonebanks" <stonec.register@sympatico.ca> writes:
> The only way I can see this happening is that an
> acache_mdx_logic_address_validation sneaks in before the insert and after
> the NOT EXISTS... SELECT. And for that to occur, the client must be mistaken
> and something else MUST be running and inserting into
> acache_mdx_logic_address_validation.

That seems like the way to bet to me.  Note that the window can actually
be wider than it might seem because of MVCC considerations --- for
example, if the conflicting insert has been done by an uncommitted
transaction, the EXISTS will fly right past the uncommitted row, but
then the index insertion will wait patiently to see if the conflicting
row commits, whereupon it will throw the error.

            regards, tom lane


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

Предыдущее
От: Steven Schlansker
Дата:
Сообщение: Re: Simple SQL INSERT to avoid duplication failed: why?
Следующее
От: Yang Zhang
Дата:
Сообщение: OK to put temp tablespace on volatile storage or to omit it from backups?