Thread: SELECT ... FOR UPDATE
I have to create a program to use the lastest version of PostgreSQL. Many processes of this program must run in parallele. In a table I have to select some specific row next insert a new row with the same search carateristiques and commit. But between the select and the insert action none other proccesses execute the same research parameters (which must return the same lines) before the commit of the first process. Or the result of the second select must contain the insert result of the precedent process. I known I must use SELECT FOR UPDATE and or BEGIN section with lock table. What is the lock option mode. Thanks a lot for all the informations. For resume I would like to do a SELECT ... FOR UPDATE with the option NOWAIT (cf. ORACLE instruction).