- 同一个进程对表的同一行
select with update
是没有问题的 - 不同进程对表的同一行
select with update
是会造成lock transaction
。要等其中一方commit
。 idle in transaction
,如果开启了一个空闲的事务,会有一个超时时间,postgres
会断开这个transaction。解决方法是try catch掉,重新commit
z_uid | c_uid |
---|---|
1 | a |
1 | b |
2 | m |
select DISTINCT z_uid from t
select count(DISTINCT z_uid) from t
select DISTINCT T.z_uid from (select z.uid as z_uid,c.uid as c_uid from z,c) as T