Tom Lane wrote:

 >Lamar Owen <[EMAIL PROTECTED]> writes:
 >
 >><snip>
 >>
 >
 ><snip>
 >
 >Another possibility, given that any app using a feature like this is
 >nonportable anyway, is to extend the INSERT statement along the lines
 >that someone (maybe Larry R?  I forget now) proposed before:
 >
 >      INSERT INTO foo ... RETURNING x,y,z,...
 >
 >where x,y,z, etc are expressions in the variables of the inserted
 >tuple(s).  This could be made to look like a SELECT at the protocol
 >level, which would mean that it wouldn't break client libraries or
 >require a protocol bump, and it's *way* more flexible than any
 >hardwired decision about what columns to return.  It wouldn't have
 >any problem with multiple tuples inserted by an INSERT ... SELECT,
 >either.
 >

This would be a good thing (tm).  I use Oracle quite extensively as well
as PG and Oracle's method of "RETURNING :avalue" is very good for
returning values from newly inserted rows.

There was some talk a while back about [not?] implementing variable
binding.  This seems to become very closely related to that. It would 
seem to solve the problem of having a unique identifier returned for 
inserts.  I'm sure it would please quite a few people in the process, 
especially ones moving across from Oracle.  (kill two birds with one stone)

 >
 > 
                regards, tom lane
 >

Ashley Cambrell




---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to