Re: Return serial from insert

Поиск
Список
Период
Сортировка
От Rory Campbell-Lange
Тема Re: Return serial from insert
Дата
Msg-id 20021108160207.GC15280@campbell-lange.net
обсуждение исходный текст
Ответ на Re: Return serial from insert  (Rod Kreisler <rod@23net.net>)
Ответы Re: Return serial from insert
Список pgsql-novice
The problem is that I need to use the id for naming an image file.
Consequently I need the id from the insert. You will note (from my
original messgage) that I'm already using a SERIAL type field for the id
column.

On 08/11/02, Rod Kreisler (rod@23net.net) wrote:
> You should get the nextval() from the sequence and use that for the new
> insert and all related inserts.
>
> > -----Original Message-----
> > From: pgsql-novice-owner@postgresql.org
> > [mailto:pgsql-novice-owner@postgresql.org]On Behalf Of Rory
> > Campbell-Lange
> > Sent: Friday, November 08, 2002 10:30 AM
> > To: pgsql-novice@postgresql.org
> > Subject: [NOVICE] Return serial from insert
> >
> >
> > I would like to return the autoincremented serial number resulting from
> > a new insert into a table, ideally as a result from the insert
> > statement.

--
Rory Campbell-Lange
<rory@campbell-lange.net>
<www.campbell-lange.net>

В списке pgsql-novice по дате отправления:

Предыдущее
От: Joel Rodrigues
Дата:
Сообщение: Re: using functions to generate custom error messages
Следующее
От: Malcolm Hutty
Дата:
Сообщение: Efficiency of stored procedure vs large join