Hi Lukas, Actually i tested it when immediately when you released 1.6.5 but forgot post about it. Sorry for that.
Yes, it works like a charm! Thank you for addressing this issue! Wouldn't it be possible (and a good idea?) to also request the other columns in the RETURNING clause instead of only the primary key? After all the other columns could be filled or manipulated by sequences or triggers too. Not really necessary for me, just something that crossed my mind.. Sander On Sep 12, 8:38 pm, Lukas Eder <[email protected]> wrote: > Hello Sander, > > Have you had time to verify the fix for this > ticket?https://sourceforge.net/apps/trac/jooq/ticket/802 > > With jOOQ 1.6.5 / 1.6.6, Postgres' INSERT .. RETURNING clause is now > fully supported, also for multi-record inserts > > Cheers > Lukas > > 2011/8/23 Lukas Eder <[email protected]>: > > > > > > > > > Hello Sander, > > > Thanks for reporting that issue about risking race conditions or other > > inconsistencies with lastID() for Postgres: > >https://sourceforge.net/apps/trac/jooq/ticket/802 > > > This reminds me of another task that has been on the roadmap for a while: > >http://sourceforge.net/apps/trac/jooq/ticket/558 > > > MySQL supports an INSERT ... ON DUPLICATE KEY UPDATE ... clause, which > > is a very convenient short-cut for the SQL standard MERGE statement. > > Both statements are supported since jOOQ 1.6.0 > > > In those five dialects that support the MERGE statement (DB2, HSQLDB, > > Oracle, SQL Server, Sybase), the ON DUPLICATE KEY UPDATE clause can be > > supported "natively". In other dialects, simulation might be possible > > by running a SELECT followed by an INSERT / UPDATE, or by running an > > INSERT followed by an UPDATE on exception. These simulations will > > cause the same issues as you have experienced with lastID(). If not > > properly wrapped in transactions, race conditions can occur, and in > > the SELECT -> INSERT / UPDATE case, even deadlocks. > > > Do you have any experience / ideas with this sort of statement / > > processing in Postgres? That might be very useful for other users, too > > > Cheers > > Lukas
