Re: BUG #15967: Sequence generation using NEXTVAL() fails on 64bit systems

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: BUG #15967: Sequence generation using NEXTVAL() fails on 64bit systems
Дата
Msg-id CAHyXU0yt1RzjhYrJ2M1Y4EPkRo8ZaWOer4SOuM1UveHUFsLb-A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #15967: Sequence generation using NEXTVAL() fails on 64bit systems  (Christoph Ziegenberg <ziegenberg@web.de>)
Список pgsql-bugs
On Wed, Aug 21, 2019 at 8:27 AM Christoph Ziegenberg <ziegenberg@web.de> wrote:
>
> Good news: We finally found the error.
>
> It was a trigger on one table that updated the sequence using setval()... Of course this cannot work and I don't know
whythis was added (perhaps for a migration script?).
 
>
> This use of setval() via the trigger was missing in the Postgres statement log (perhaps because it was a PERFORM
statement?),so we didn't find it earlier.
 
>
> Sorry and thanks for your help to all.

No worries, glad you found the issue.  I mean, nextval() is probably
the most commonly trafficked function in the database and is dead
reliable for millions of users, so there had to be another
explanation, right? :-).   setval() is an extremely dangerous function
outside of cases related to restoring data; it modifies state outside
of transactional guarantees.   if you saw it in code not guarded by
some kind of lock you ought to be suspicious.

merlin



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

Предыдущее
От: Christoph Ziegenberg
Дата:
Сообщение: Re: BUG #15967: Sequence generation using NEXTVAL() fails on 64bit systems
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: BUG #15954: Unable to alter partitioned table to set logged