| От | florence.henry@obspm.fr (Florence HENRY) |
|---|---|
| Тема | Does INSERT inserts always at the end ? |
| Дата | |
| Msg-id | f24d453f.0405190519.6dd23275@posting.google.com обсуждение |
| Ответы |
Re: Does INSERT inserts always at the end ?
|
| Список | pgsql-general |
Hello, well, almost everything is in the subject ! I have to fill 2 tables (more complicated than in the example !): CREATE TABLE A ( id serial primary key, foo text); CREATE TABLE B ( id serial references A, bar text); I fill A with : INSERT into A VALUES (DEFAULT, "toto"); Then I need to retreive the "A.id" that was given to A, in order to give it to B.id. If I was doing this by hand, it would have been quite easy, but I'm doing this with a script. So, if I make a SELECT id from A; and take the last row, will it *always* be the row that I've just inserted. Thanks for any tip -- Florence HENRY
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера