pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #14359: serial datatype issue
2+ messages / 2 participants
[nested] [flat]

* BUG #14359: serial datatype issue
@ 2016-10-07 08:51  debaratis@techmahindra.com
  0 siblings, 1 reply; 2+ messages in thread

From: debaratis@techmahindra.com @ 2016-10-07 08:51 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      14359
Logged by:          Debarati Sengupta
Email address:      debaratis@techmahindra.com
PostgreSQL version: 9.4.5
Operating system:   Windows
Description:        

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. 


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #14359: serial datatype issue
@ 2016-10-07 12:09  hubert depesz lubaczewski <depesz@depesz.com>
  parent: debaratis@techmahindra.com
  0 siblings, 0 replies; 2+ messages in thread

From: hubert depesz lubaczewski @ 2016-10-07 12:09 UTC (permalink / raw)
  To: debaratis@techmahindra.com; +Cc: 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/


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2016-10-07 12:09 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-10-07 08:51 BUG #14359: serial datatype issue debaratis@techmahindra.com
2016-10-07 12:09 ` hubert depesz lubaczewski <depesz@depesz.com>

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