Re: unlock rows

From: Dennis Gearon <gearond(at)cvc(dot)net>
To: jose antonio leo <jaleo8(at)storelandia(dot)com>, "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: unlock rows
Date: 2003-03-13 18:58:57
Message-ID: TJDKH83PJ42NLKFVP1UA8E0ICHC71NL.3e70d4f1@cal-lab
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2003-03-13 19:04:39 Re: [GENERAL] PL/Java (was: stored procedures)
Previous Message Dousak May (Phoebus Apollonus) 2003-03-13 18:56:02 Function in selection?