Capture insert returning - Mailing list pgsql-sql

From scorpdaddy@hotmail.com
Subject Capture insert returning
Date
Msg-id BLU0-SMTP60973B8169016D96D718D0CEA70@phx.gbl
Whole thread Raw
List pgsql-sql


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.


pgsql-sql by date:

Previous
From: msi77
Date:
Subject: Re: Aggregates puzzle
Next
From: Anish Kejariwal
Date:
Subject: pass in array to function for use by where clause? how optimize?