Bruno Boettcher writes:
> i have a lots of threads that work on a table, making insertions,
> updates removes.....
>
> now i certain cases its important to keep data integrity, so i looked
> into locks....
Only in certain cases??? ;-)
> all i found was a lock function that locks the entire table....
There are also row level locks, which are automatically acquired when
needed. The best way to lock specific rows is the SELECT ... FOR UPDATE
statement. Playing with the LOCK command is generally not necessary.
> and what happens to other insert queries whilst the lock is operational?
> Are they postponed and the valling thread waits, or does the call return
> with an error?
That depends on the transaction isolation level (which you can set). See
the chapter on concurrency control in the User's Guide for more
information.
--
Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter