Thread: Capture insert returning

Capture insert returning

From
scorpdaddy@hotmail.com
Date:


Considering jdbc to pg8.4, is there a way to save results of "INSERT ... RETURNING *" to a temp table within the transaction, knowing that INSERT RETURNING is a pg specific augmentation to standard SQL.


This doesn't seem to work:


CREATE TEMP TABLE bar ON COMMIT DROP AS

INSERT INTO foo(a, b)

SELECT a, b FROM another_foo

RETURNING *;


The idea is to capture foo's pk, a, b in bar.