Skip site navigation (1) Skip section navigation (2)

Re: INSERT ... RETURNING

From: "Kevin McArthur" <Kevin(at)StormTide(dot)ca>
To: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>, <omar(at)tinysofa(dot)org>
Cc: <pgsql-patches(at)postgresql(dot)org>
Subject: Re: INSERT ... RETURNING
Date: 2005-07-30 02:39:36
Message-ID: 000b01c594af$eda183a0$0701a8c0@kdesktop (view raw or flat)
Thread:
Lists: pgsql-patches
Here here on this one.

With the deprecation of oids on the horizon insert returning is to be 
extremely important. It's use with the uniqueidentifier mod would be really 
really helpful.

On a similar note, is anyone working on the ability to have a column default 
as the product of a function on another column of the same row. I know this 
can be done as a trigger but something like CREATE TABLE abc (name text not 
null unique, hash not null default somehashfunc(name)); would be very 
convenient, and of course with the ability to get the product back with 
insert returning.

Kevin McArthur

----- Original Message ----- 
From: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: <omar(at)tinysofa(dot)org>
Cc: <pgsql-patches(at)postgresql(dot)org>
Sent: Friday, July 29, 2005 7:26 PM
Subject: Re: [PATCHES] INSERT ... RETURNING


>
> Are you still working on completing this?
>
> ---------------------------------------------------------------------------
>
> omar(at)tinysofa(dot)org wrote:
>> Hi there,
>>
>> Attached is a patch (by Gavin Sherry, fixed up to apply to 8.1 by me) 
>> that
>> implements INSERT ... RETURNING functionality.
>>
>> It does work for the common case of RETURNING the value of a 
>> serial/sequence
>> column, but gets confused when returning results out-of-order (CREATE 
>> TABLE x
>> (a int, b int), INSERT ... RETURNING b, a) and doesn't let you specify 
>> the same
>> column multiple times (INSERT ... RETURNING b, b). These will be 
>> addressed
>> soon.
>>
>> Regards,
>> Omar Kilani
>
> [ Attachment, skipping... ]
>
>>
>> ---------------------------(end of broadcast)---------------------------
>> TIP 3: if posting/reading through Usenet, please send an appropriate
>>        subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
>>        message can get through to the mailing list cleanly
>
> -- 
>  Bruce Momjian                        |  http://candle.pha.pa.us
>  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
>  +  If your life is a hard drive,     |  13 Roberts Road
>  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 
> 19073
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>               http://archives.postgresql.org
> 


In response to

pgsql-patches by date

Next:From: Bruce MomjianDate: 2005-07-30 03:24:37
Subject: Re: PL/Perl list value return causes segfault
Previous:From: Bruce MomjianDate: 2005-07-30 02:26:19
Subject: Re: INSERT ... RETURNING

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group