From: hubert depesz lubaczewski <depesz@depesz.com>
To: debaratis@techmahindra.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14359: serial datatype issue
Date: Fri, 7 Oct 2016 14:09:53 +0200
Message-ID: <20161007120953.655cxzfdmdamasr7@depesz.com> (raw)
In-Reply-To: <20161007085101.1412.11450@wrigleys.postgresql.org>
References: <20161007085101.1412.11450@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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/
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: depesz@depesz.com, debaratis@techmahindra.com
Subject: Re: BUG #14359: serial datatype issue
In-Reply-To: <20161007120953.655cxzfdmdamasr7@depesz.com>
References: <20161007085101.1412.11450@wrigleys.postgresql.org> <20161007120953.655cxzfdmdamasr7@depesz.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox