From: Gunnar \"Nick\" Bluth <gunnar.bluth.extern@elster.de>
To: pgsql-admin@postgresql.org
Subject: Re: postgresql : could not serialize access due to read/write dependencies among transactions
Date: Fri, 10 Feb 2017 11:23:20 +0100
Message-ID: <debbe02c-035d-04c8-ce40-f7e95529e196@elster.de> (raw)
In-Reply-To: <AM5PR0501MB2433DC840DADE96339CACF6E9B7F0@AM5PR0501MB2433.eurprd05.prod.outlook.com>
References: <AM5PR0501MB2433DC840DADE96339CACF6E9B7F0@AM5PR0501MB2433.eurprd05.prod.outlook.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>
Am 01/18/2017 um 05:54 AM schrieb Neslisah Demirci:
> Hi ,
>
>
> I have problem about this issue ;
>
>
> could not serialize access due to read/write dependencies among transactions
That's something you have to expect when using SERIALIZABLE isolation
level. Maybe re-read
https://www.postgresql.org/docs/current/static/transaction-iso.html#XACT-SERIALIZABLE> A message app like whatsapp i decided to use isolation level
> serializable if i use other transaction levels many conversations
> started with same number (think about whatsapp web sidebar multipling
> with same number every message).
Are you not using a sequence for generating these IDs? As those are
counting independent of transaction visibility...
What you say sounds more like "SELECT max(conversation_id) + 1 AS
new_conversation_id FROM ..."
> I also add an index to my query and my query's execution plan don't use
> seq scan .
>
>
> How can i solve this issue ? Can i solve this on db orr on app ?
a) switch to a sequence for generating these IDs (you can go back to a
lower isolation level then). You may get holes in the IDs then (on
rolled back transactions), but I don't see how that would not be
acceptable for conversation IDs
b) deal with it in the app (probably not what you want, think roud-trip
time)
> Nesliþah Demirci | Veritabaný Yöneticisi
>
> Ayazaða cad. No:4 Uniq Ýstanbul Plaza
> B2 /Kat:3 34396 Ayazaða-SARIYER-Ýstanbul
> T. (+90) 212 453 16 00 5516
> F. (+90) 212 453 16 16
> www.markafoni.com <http://www.markafoni.com/;
> www.facebook.com/markafoni <http://www.facebook.com/markafoni;
> blog.markafoni.com
>
>
>
Regards,
--
Gunnar "Nick" Bluth
DBA ELSTER
Tel: +49 911/991-4665
Mobil: +49 172/8853339
Attachments:
smime.p7s (application/pkcs7-signature, 4.0K) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: gunnar.bluth.extern@elster.de
Subject: Re: postgresql : could not serialize access due to read/write dependencies among transactions
In-Reply-To: <debbe02c-035d-04c8-ce40-f7e95529e196@elster.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox