By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE m0_curve (ctrl REAL, flow REAL, power REAL, pressure REAL);
✓
CREATE UNIQUE INDEX id_ctrl_pressure ON m0_curve(ctrl, pressure);
✓
INSERT INTO m0_curve (ctrl, flow, power, pressure) VALUES ('0', '1', '1', '117.21')
ON CONFLICT(ctrl, pressure) DO UPDATE
SET flow = '0' , power = '0';
✓
SELECT * FROM m0_curve;
ctrl | flow | power | pressure |
---|---|---|---|
0 | 1 | 1 | 117.21 |
INSERT INTO m0_curve (ctrl, flow, power, pressure) VALUES ('0', '0', '0', '117.21')
ON CONFLICT(ctrl, pressure) DO UPDATE
SET flow = EXCLUDED.flow,
power = EXCLUDED.power;
✓
SELECT * FROM m0_curve;
ctrl | flow | power | pressure |
---|---|---|---|
0 | 0 | 0 | 117.21 |