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.marlowe@ihs.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
> >
>
>
>
>