Re: Ynt:[GENERAL] postgresql : could not serialize access due toread/write dependencies among transactions

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: Ynt:[GENERAL] postgresql : could not serialize access due toread/write dependencies among transactions
Дата
Msg-id 50fed51c-a0af-871d-185a-4508caa24014@hogranch.com
обсуждение исходный текст
Ответ на Ynt:[GENERAL] postgresql : could not serialize access due toread/write dependencies among transactions  (Neslisah Demirci <neslisah.demirci@markafoni.com>)
Ответы Re: Ynt:[GENERAL] postgresql : could not serialize access due toread/write dependencies among transactions
Список pgsql-general
On 1/17/2017 9:41 PM, Neslisah Demirci wrote:


First I started conversation between two person ; 


sql: 'INSERT INTO "XXXXX" ("id","customer","createdAt","updatedAt","CompanyId") VALUES (DEFAULT,\'905322653555\',\'2017-01-17 19:13:37.751 +00:00\',\'2017-01-17 19:13:37.751 +00:00\',\'1\') RETURNING *;' }, 


name: 'error', length: 274, severity: 'ERROR', code: '40001', detail: 'Reason code: Canceled on identification as a pivot, during write.', hint: 'The transaction might succeed if retried.', position: undefined, internalPosition: undefined, internalQuery: undefined, where: undefined, schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'predicate.c', line: '4605', routine: 'OnConflict_CheckForSerializationFailure', 


that reason code doesn't sound like anything PostgreSQL generates.    SQLSTATE 40001 is "serialization_failure", but all that stuff about 'identification as a pivot' ?    that must be your ORM.    Many ORM's are very broken if you try and do anything outside the ORM designer's way of thinking.

was this insert done inside a transaction?  was it the first thing done in this transaction?    when you got the error, did you rollback the transaction and retry?    once you've gotten an error in a transaction, no further queries can be done until you rollback the transaction and start a new one.


-- 
john r pierce, recycling bits in santa cruz

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

Предыдущее
От: Neslisah Demirci
Дата:
Сообщение: Ynt:[GENERAL] postgresql : could not serialize access due toread/write dependencies among transactions
Следующее
От: Christoph Moench-Tegeder
Дата:
Сообщение: Re: Ynt:[GENERAL] postgresql : could not serialize access due toread/write dependencies among transactions