Re: unlock rows

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Dennis Gearon <gearond(at)cvc(dot)net>
Cc: jose antonio leo <jaleo8(at)storelandia(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: unlock rows
Date: 2003-03-13 19:09:06
Message-ID: Pine.LNX.4.33.0303131208480.21496-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

You can acheive that functionality in a serialized transaction, no need to
issue your own locks.

On Thu, 13 Mar 2003, Dennis Gearon wrote:

> What about if one is using a row as a semaphore?
>
> For example, a script accessing the database needs to know if a certain table has any rows in it
> with 'appoved::bool' equal to false before it inserts a row that WILL have that set to false.
> that way, it will generate an email to the site owner to go and look at items in that table and
> approve them.
>
> I wouldn't want an email for each line added.
>
>
> 3/13/2003 9:31:53 AM, "scott.marlowe" <scott(dot)marlowe(at)ihs(dot)com> wrote:
>
> >On Thu, 13 Mar 2003, jose antonio leo wrote:
> >
> >> Hi guys,
> >>
> >> I want to control and I know the rows blocks in a table. If it is necesary
> >> unlock the rows.
> >> How can I do it?
> >> Can I put a timeout and unlock the rows after?
> >> Maybe a pgsql parameter?
> >
> >Are you sure that's what you want?
> >
> >Postgresql uses MVCC for locking, which is basically better than row level
> >locking. In fact, this system allows multiple writes to be occuring to
> >your database, and for the readers to never be blocked.
> >
> >Locking individual rows is a recipe for disaster under heavy parallel
> >load, and is usually overkill for data integrity in about 90% of all
> >applications.
> >
> >What are you trying to accomplish? Telling us that may help us figure out
> >a better (faster, more reliable, more scalable) answer.
> >
> >Row locking is almost always NOT it.
> >
> >
> >---------------------------(end of broadcast)---------------------------
> >TIP 4: Don't 'kill -9' the postmaster
> >
>
>
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Darley 2003-03-13 19:11:05 Re: Function in selection?
Previous Message Joe Conway 2003-03-13 19:04:39 Re: [GENERAL] PL/Java (was: stored procedures)