Re: Locking & concurrency - best practices

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Adam Rich" <adam(dot)r(at)indigodynamic(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Locking & concurrency - best practices
Date: 2008-01-14 21:15:00
Message-ID: dcc563d10801141315p2374d78fo1e5c0b617cb646cd@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Jan 14, 2008 2:43 PM, Adam Rich <adam(dot)r(at)indigodynamic(dot)com> wrote:
>
> I have a "parent_tbl" and dozens of data tables, with foreign keys
> referencing the PK of "parent_tbl" (one-to-many). There are 100+
> users accessing the application, usually (but not always) each user
> is working on a different record in parent_tbl. (this would seem like
> a pretty standard scenario for a lot of apps)

You should be able to do "select for update" on both parent and child
records and get the effect you desire.

Think up your own worst case scenario for concurrent updates, then sit
down at two or more psql terminals, and try to simulate such a thing
and see what happens. Experimentation is a great tool.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Davis 2008-01-14 21:29:18 Re: Index trouble with 8.3b4
Previous Message danilo.juvinao 2008-01-14 21:11:50 Re: know the schema name in a trigger