![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
user1 executes an update or delete with transaction for 10/20 seconds in a rekord with pk 1. Why in this time other user(user2) makes a select on that rekord reads uncommited data? I want that user2 reads commited data!! I tried with isolation SERIALIZABLE, but I have self result! If user2 deletes or updates that rekord the transaction works and waits commit of user1. |
#3
| |||
| |||
|
|
You cannot see uncommitted data in PostgreSQL from another transaction. |
|
Yours, Laurenz Albe |
#4
| |||
| |||
|
|
Laurenz Albe ha scritto: You cannot see uncommitted data in PostgreSQL from another transaction. Sorry,I'm wrong word! I wanted say previous data. When I make a SELECT on data, if there is a transaction on it, how I can know that data is in state of modification from an other user or to make execute the SELECT after that the transaction of the other is ended ? Tnks bye! You can lock a table using |
| Yours, Laurenz Albe |
#5
| |||
| |||
|
|
You cannot see uncommitted data in PostgreSQL from another transaction. Sorry,I'm wrong word! I wanted say previous data. When I make a SELECT on data, if there is a transaction on it, how I can know that data is in state of modification from an other user or to make execute the SELECT after that the transaction of the other is ended ? You can lock a table using LOCK TABLE foo IN ACCESS EXCLUSIVE MODE from inside of your transaction to achieve that. |
#6
| |||
| |||
|
|
You can always make sure that nobody is modifying the row you are reading with SELECT ... FOR UPDATE |
![]() |
| Thread Tools | |
| Display Modes | |
| |