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.