Re: BUG #14359: serial datatype issue

Поиск
Список
Период
Сортировка
От hubert depesz lubaczewski
Тема Re: BUG #14359: serial datatype issue
Дата
Msg-id 20161007120953.655cxzfdmdamasr7@depesz.com
обсуждение исходный текст
Ответ на BUG #14359: serial datatype issue  (debaratis@techmahindra.com)
Список pgsql-bugs
On Fri, Oct 07, 2016 at 08:51:01AM +0000, debaratis@techmahindra.com wrote:
> I have created tables with primary key as serial datatype, while inserting
> data through functions at times the next value is not generated and it tries
> inserting data with the same value, hence conflicting and raising error
> saying the value already exists.

it means that something in your database is inserting data to table with
specifying explicit value, like:

insert into table (id, a, b, c) values (123, 'a', 'b', 'c');

and does not rely on sequence.

if nextval() is not called (and it's not if you provide value for id
column in insert) then sequence doesn't increment, and you'll get
errors.

Find what issues these bad inserts, and fix it.

Best regards,

depesz

--
The best thing about modern society is how easy it is to avoid contact with it.
                                                             http://depesz.com/

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

Предыдущее
От: "Zuk, Kacper"
Дата:
Сообщение: Re: BUG #14329: libpq doesn't send complete client certificate chain on first SSL connection
Следующее
От: hubert depesz lubaczewski
Дата:
Сообщение: Re: Rows go missing when selecting "for update" after savepoint "play"