Open kaaveland opened 3 hours ago
On the big picture side, I think tables where all columns appear in the primary key should get a different interface, with Set
-like API.
However, the time for that is not really now, so in the meantime I'd be ok with a fix like what you propose.
This code will throw an exception if the row is already present in the table:
The reason is that postgres returns no rows when it executes
do nothing
(I'm not entirely sure why this choice was made). I guess this is a special case because all the columns are part of the primary key, so there are no remaining columns to update. The following code would return a row even if it was already present (only thedo nothing
line is changed):I'd be happy to take a stab at this if we agree that we should.