From: | John Tregea <john(at)debraneys(dot)com> |
---|---|
To: | Tim Allen <tim(at)proximity(dot)com(dot)au> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Return the primary key of a newly inserted row? |
Date: | 2006-06-22 05:01:53 |
Message-ID: | 449A2441.2040700@debraneys.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi Tim,
Thanks for the advice, it saves me continuing to dig in the help files
and my reference books any longer. I don't know how much help I could be
in adding features but I am glad to participate in any way I can in the
community. I will follow your link to the TODO pages.
Thanks again.
Regards
John
Tim Allen wrote:
> John Tregea wrote:
>> Greeting again,
>>
>> I am writing records to postgreSQL from an IDE called revolution. At
>> the time I perform the INSERT command I need to retrieve the value of
>> the serial_id column from the newly created row.
>>
>> Is it possible to have a specified column value returned after the
>> INSERT (rather than the number of rows affected) ?
>>
>> That would save me doing a SELECT select statement after every INSERT.
>>
>> Please excuse the terminology if it is not SQL'esque, but I hope you
>> know what I am getting at.
>>
>> Thanks in advance
>>
>> John Tregea
>
> It's not supported now, however it has been discussed several times,
> and there is a TODO entry for it at
>
> http://www.postgresql.org/docs/faqs.TODO.html
>
> using syntax along the lines of INSERT ... RETURNING ...
>
> Search for the word "returning" in the todo list and you'll find the
> entry. Your options include waiting for someone to make it happen (no
> telling how long that will be), or helping to make it happen (for
> which we would all thank you :-) ). In the meantime you'll have to
> work around it, as you suggested.
>
> Tim
>
From | Date | Subject | |
---|---|---|---|
Next Message | nuno | 2006-06-22 05:59:42 | sql question; checks if data already exists before inserted |
Previous Message | Bill Moseley | 2006-06-22 04:58:20 | Missing domain socket after reboot. |