Re: Problems with sequences

Поиск
Список
Период
Сортировка
От Arturo Perez
Тема Re: Problems with sequences
Дата
Msg-id 4AA304A4DBB6414199F18D7E324EBDE9016C0523@HAYES3.HAYESINC.ORG
обсуждение исходный текст
Ответ на Problems with sequences  ("Arturo Perez" <aperez@hayesinc.com>)
Ответы Re: Problems with sequences  (Alban Hertroys <alban@magproductions.nl>)
Список pgsql-general
From: Alban Hertroys [mailto:alban@magproductions.nl]
>Martijn van Oosterhout wrote:
>> On Thu, Sep 07, 2006 at 07:15:43AM -0400, Arturo Perez wrote:
>>> iht=> select max(article_id) from article;
>>> max
>>> ------
>>> 4992
>>> (1 row)
>>>
>>> iht=> select nextval('pk_article');
>>> nextval
>>> ---------
>>>     4986
>>> (1 row)
>>>
>>> Assuming the sequence number is being used correctly why would they
>> be 6 apart?
>>
>> The last four transactions could be rolled back, or not committed yet.
>
>   b) the OP inserted numbers not coming from the sequence; he shot his
>own feet.


I prefer to think that my feet were shot off by a library I'm using :-)
Some many layers, so little time (to debug).

In any case, at this point in time it's looking like Cayenne doesn't honor
the rules of the sequence.  It appears to (and is documented as) internally
incrementing rather than fetching the sequence for each insert.

I would still like more debugging tips for this sort of thing.  As I mentioned,
statement logging did not show the relevant details.  What other things could
I have done?

-arturo

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

Предыдущее
От: Andrew Sullivan
Дата:
Сообщение: Re: Replace NULL values
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Majordomo drops multi-line Subject: