insert two tables taking serial from table1

Поиск
Список
Период
Сортировка
От Jim (s/nosp@m/@/ to reply)
Тема insert two tables taking serial from table1
Дата
Msg-id rq7l9.472105$_91.685798@rwcrnsc51.ops.asp.att.net
обсуждение исходный текст
Ответы Re: insert two tables taking serial from table1  (Tino Wildenhain <tino@wildenhain.de>)
Список pgsql-general
I've been looking around for a way to set up an insert to table 1 then take
the serial from table 1 that autoincrimented and add it to table 2. I've
seen ways people have done it by grabbing last row of the table but I am
concerned about a connection that doesn't need to add to table 2 inserting
into the last table  before table 1 can be queried. and thus getting the
relation to the wrong row. Is there a way to get the oid from the insert?
using php incase that helps.


thought about doing an exact search on what was just inserted but table has
possibility of users adding exactly the same data. have thought about
combining the tables but don't want an overgrown table with more rows then I
can maneuver through.

thanks in advance for any help.
Jim



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

Предыдущее
От: Daniel Morgan
Дата:
Сообщение: Re: Feature comparison between Postgresql, Oracle and Mysql ?
Следующее
От: "Peter Kovacs"
Дата:
Сообщение: Re: [JDBC] Prepared statement performance...