2 ms·
The syntax looks inconvenient, but I like it. If you have a conflict, you might not want to just update everything, but only a subset of the fields. With this s
by mbreese 12y ago
The syntax looks inconvenient, but I like it. If you have a conflict, you might not want to just update everything, but only a subset of the fields. With this syntax (verbose as it is), you have the option of explicitly stating what you want to happen in the event of a conflict with no ambiguity. Perhaps there is a place for some shorthand like
ON CONFLICT SET *=*.
But aside from that, for a RDBMS like Postgres, I'd opt for explicit over implicit.
- tracker1 12y agoOne would think you would just need a list of fields... ON CONFLICT SET colA,colB,colC As to the gp, you don't want to update the "CREATED" field on an upsert.