Re: [Q] Serializable - Mailing list pgsql-general

From David G. Johnston
Subject Re: [Q] Serializable
Date
Msg-id CAKFQuwZ2oR-3RJP0vJ+p0R4xSk7PG1xfTev-CL50rBZ1GJSN4A@mail.gmail.com
Whole thread Raw
In response to [Q] Serializable  (Ladislav Lenart <lenartlad@volny.cz>)
Responses Re: [Q] Serializable
List pgsql-general
On Thu, Sep 24, 2015 at 12:15 PM, Ladislav Lenart <lenartlad@volny.cz> wrote:
Hello.

I would like to know how SERIALIZABLE behaves.

Suppose I have two (or more) concurrent DB transactions:
* Each runs in SERIALIZABLE.
* Each updates (insert / update / delete) different rows in the same table.

Can I get serializable failures (i.e. ERROR: could not serialize access due to
read/write dependencies among transactions)?

This is on 9.4.

Thank you in advance,

​Probably not but there seems to be insufficient information provided to prove this.  You seem to probably have the "write dependency" covered but you mention nothing about "read dependencies".

Why not just assume it can and put code in place to handle that possibility - especially since you should probably be frameworking database access to enforce that all parts of the system use SERIALIZABLE?

David J.
 

pgsql-general by date:

Previous
From: Ladislav Lenart
Date:
Subject: [Q] Serializable
Next
From: Francisco Reyes
Date:
Subject: Dropped connections with pg_basebackup