Re: trigger that needs a PK

Поиск
Список
Период
Сортировка
От A. Kretschmer
Тема Re: trigger that needs a PK
Дата
Msg-id 20080213083527.GF24109@a-kretschmer.de
обсуждение исходный текст
Ответ на Re: trigger that needs a PK  (johnf <jfabiani@yolo.com>)
Ответы Re: trigger that needs a PK
Список pgsql-novice
am  Tue, dem 12.02.2008, um 23:46:41 -0800 mailte johnf folgendes:
> > http://www.postgresql.org/docs/current/static/functions-sequence.html
> >
> >
> > HTH, Andreas
>
> But how do I do automaticly???
>
> You code implies that I just string two inserts together.  I was hoping to use
> rules or some other way to do it automaticly.

currval() returns the last inserted value within the current session, it
is the usual way to insert into the parent table and use currval() to
obtain the last inserted serial value for inserts into the child table.


Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

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

Предыдущее
От: johnf
Дата:
Сообщение: Re: trigger that needs a PK
Следующее
От: johnf
Дата:
Сообщение: Re: trigger that needs a PK