Re: [NOVICE] Last ID Problem

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: [NOVICE] Last ID Problem
Дата
Msg-id 877jlqoq6s.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: [NOVICE] Last ID Problem  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [NOVICE] Last ID Problem  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:

> How is what you're suggesting more portable?

Well, the driver would be free to implement $sth->last_insert_id() using
whatever proprietary extensions it has available. The non-portableness would
at least be hidden in the driver layer. Switch out the driver and the right
thing would happen.

"INSERT/UPDATE ... RETURNING" isn't something a driver can take advantage of.
It would require it to modify your statements which it can't do safely. So
your application would have such non-portable SQL code written into it. Switch
databases and your application code needs to be ported.

-- 
greg



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: libpq API incompatibility between 7.4 and 8.0
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [BUGS] Bug in create operator and/or initdb