Benjamin <benjamin (AT) netyantra (DOT) com> writes:
Quote:
I have a C application. I have to modify a row in a table, n then
immediately access a field in that row.
These operation of modifying and accessing has to be atomic.So, i have
to lock the row. |
The UPDATE in your example does that already; I think you should just
drop the LOCK ...
Quote:
BEGIN; LOCK TABLE tablename in ROW EXCLUSIVE MODE; UPDATE tablename set
colname=value WHERE rowprimary='a' ; SELECT b from tablename WHERE
rowprimary='a'; COMMIT; |
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match