Re: portable DBAPI auto-increment

Поиск
Список
Период
Сортировка
От Marko Kreen
Тема Re: portable DBAPI auto-increment
Дата
Msg-id BANLkTikpxcur-5dCAZ7dMNwNWAD3KffNGA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: portable DBAPI auto-increment  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Ответы Re: portable DBAPI auto-increment  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Список psycopg
On Fri, Apr 8, 2011 at 12:52 PM, Karsten Hilbert
<Karsten.Hilbert@gmx.net> wrote:
> On Thu, Apr 07, 2011 at 04:40:29PM -0400, Mark Sienkiewicz wrote:
>> In psycopg2, I find that lastrowid is always 0, even though it is
>> making rows in the table with k=1, k=2, etc.
>>
>> I did some searching and found that the value of lastrowid is not
>> taken from the autoincrementing column, but is some non-unique entity
>> called an OID.
>
> OIDs *are* unique per table.

Actually they are not - you need unique index on oid column for that.

That is also one of the reasons to avoid them...

--
marko

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

Предыдущее
От: David Blewett
Дата:
Сообщение: Re: portable DBAPI auto-increment
Следующее
От: Daniele Varrazzo
Дата:
Сообщение: Re: portable DBAPI auto-increment