Re: SQL-question: returning the id of an insert querry

Поиск
Список
Период
Сортировка
От Doug McNaught
Тема Re: SQL-question: returning the id of an insert querry
Дата
Msg-id 87vfppwflu.fsf@asmodeus.mcnaught.org
обсуждение исходный текст
Ответ на Re: SQL-question: returning the id of an insert querry  ("David Green" <david@sagerobot.com>)
Ответы Re: SQL-question: returning the id of an insert querry  (Scott Chapman <scott_list@mischko.com>)
Список pgsql-general
Scott Chapman <scott_list@mischko.com> writes:

> It would be nice if PostgreSQL could return the primary key it inserted
> with but that may not be a fool-proof solution either.  Is there a nice
> way to handle this situation?

Write a database function that inserts the record and returns the
primary key value?  That's probably the best way to insulate your app
from the database structure...

-Doug

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

Предыдущее
От: Scott Chapman
Дата:
Сообщение: Re: SQL-question: returning the id of an insert querry
Следующее
От: jake@omnimode.com (jake johnson)
Дата:
Сообщение: Re: More Praise for 7.4RC2