[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: [GENERAL] nooby q: how get a row just inserted?
From:       Scott Marlowe <scott.marlowe () gmail ! com>
Date:       2009-05-31 0:55:15
Message-ID: dcc563d10905301755y1497011dv1e45e9c3b7c35c75 () mail ! gmail ! com
[Download RAW message or body]

On Sat, May 30, 2009 at 6:52 PM, Kenneth Tilton <kentilton@gmail.com> wrote:
>
>
> Martin Gainty wrote:
>>
>> yes i would suggest using OID
>> included in Postgres distro is a sample create table,index named
>> fti.pl
>>
>> does this answer your question?
>
> oid would have been fine, but I am going with Rodrigo's suggestion to simply
> use the returning option on insert which I somehow missed.

One of the cool features of returning is that it can return sets.

insert into table values ('abc'),('def'),('ghi') returning id;
1
2
3

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic