Opened 4 years ago

Closed 4 years ago

#64 closed enhancement (fixed)

Add an upsert() method to the DB class

Reported by: cito Owned by:
Priority: major Milestone: 5.0
Component: Classic API Version: 4.1
Keywords: upsert Cc:

Description

Postgres 9.5 has a new UPSERT command that could be supported by a new upsert method in the DB class, in addition to the existing methods update and insert.

For Posgres versions below 9.5 it could fall back to a normal insert followed by an update if the insert throws an exception.

Change History (2)

comment:1 Changed 4 years ago by cito

Implemented in r735.

Not sure if emulating the method in PostgreSQL < 9.5 (with unavoidable race conditions) is worth the effort. A new ticket should be created for this in any case.

comment:2 Changed 4 years ago by cito

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.