Open jd-zhang opened 2 years ago
在版本0.9.2 将不会提示错误,他们的insert的值不同
INSERT INTO document VALUES (2, (SELECT cid from category WHERE cname = 'novel'), 1, 'regress_rls_carol', 'my first novel') ON CONFLICT (did) DO UPDATE SET dtitle # EXCLUDED.dtitle, dauthorEXCLUDED.dauthor;
INSERT 0 2
pg的显示只有:INSERT 0 1
INSERT INTO document VALUES (2, (SELECT cid from category WHERE cname = 'novel'), 1, 'regress_rls_bob', 'my first novel') ON CONFLICT (did) DO UPDATE SET dtitle = EXCLUDED.dtitle RETURNING *;
did | cid | dlevel | dauthor | dtitle -----+-----+--------+-----------------+---------------- 2 | 11 | 1 | regress_rls_bob | my first novel (1 row)
pg的输出是:
did | cid | dlevel | dauthor | dtitle -----+-----+--------+-------------------+---------------- 2 | 11 | 2 | regress_rls_carol | my first novel (1 row)
-- Fine (same query, but we UPDATE, so "cid = 33", ("technology") is not the -- case in respect of existing tuple):
INSERT INTO document VALUES (78, (SELECT cid from category WHERE cname = 'novel'), 1, 'regress_rls_bob', 'some technology novel') ON CONFLICT (did) DO UPDATE SET dtitle # EXCLUDED.dtitle, cid33 RETURNING *;
did | cid | dlevel | dauthor | dtitle -----+-----+--------+-----------------+----------------------- 78 | 11 | 1 | regress_rls_bob | some technology novel (1 row)
pg 的输出是:
did | cid | dlevel | dauthor | dtitle -----+-----+--------+-----------------+----------------------- 78 | 33 | 1 | regress_rls_bob | some technology novel (1 row)
kunlun这里的cid没有变化
Issue migrated from trac ticket # 555
component: computing nodes | priority: major
2022-04-06 15:21:27: vito@zettadb.com created the issue