Skip site navigation (1) Skip section navigation (2)

Re: How can I see if my code is "concurrency safe"?

From: Chris Travers <chris(dot)travers(at)gmail(dot)com>
To: Janne H <jannehson51(at)yahoo(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: How can I see if my code is "concurrency safe"?
Date: 2012-04-26 01:59:28
Message-ID: CAKt_Zfs3ND+TyT3sv0ON7KNTw8VXQw7hQ+_ABugKYhroYV8aEg@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-general
On Wed, Apr 25, 2012 at 4:17 PM, Janne H <jannehson51(at)yahoo(dot)com> wrote:
> Hi there!
>
> Today I realised that my knowledge concerning how postgres handles concurrency is not very good, and its even worse when it comes to using that knowledge in real-life.

I think what everyone here is trying to say is that while PostgreSQL
is very good at handling concurrency itself, you may want to be
careful about making sure your relational constraints are correct.
This means proper use of multi-column keys (either as primary keys,
unique constraints, or foreign keys).  If you do a good job here,
PostgreSQL will handle your concurrency needs for you.

On an internal level, look at how MVCC works. It isn't really a
question of overall concurrency so much as it is a matter of
concurrency performance, since locking is no longer as necessary.
Also check out the serializable transaction level, though the need for
this sort of concurrency protection is rare.

Best Wishes,
Chris Travers

In response to

pgsql-general by date

Next:From: Bill MoranDate: 2012-04-26 02:47:49
Subject: Re: How can I see if my code is "concurrency safe"?
Previous:From: Tom LaneDate: 2012-04-26 01:57:05
Subject: Re: Explain verbose query with CTE

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group