BUG #13507: INSERT into tables with SERIAL primary keys failing about half of the time

From: dsrich(at)dsrich(dot)net
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #13507: INSERT into tables with SERIAL primary keys failing about half of the time
Date: 2015-07-21 00:39:29
Message-ID: 20150721003929.9707.40340@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 13507
Logged by: David Richardson
Email address: dsrich(at)dsrich(dot)net
PostgreSQL version: 9.3.9
Operating system: Ubuntu 14.04
Description:

Table:

CREATE TABLE payees
(
payeenum serial NOT NULL,
payeename character varying(127) NOT NULL,
remarks text,
CONSTRAINT payees_pkey PRIMARY KEY (payeenum),
CONSTRAINT payees_payeename_key UNIQUE (payeename)
)
WITH (
OIDS=FALSE
);
ALTER TABLE payees
OWNER TO dsrich;
GRANT ALL ON TABLE payees TO dsrich;
GRANT ALL ON TABLE payees TO users;

Insert query:

INSERT INTO payees (payeename, remarks) VALUES ('some string', 'some other
string')

This query (and three other versions using DEFAULT and 'RETURNING payeenum'
clauses) fails about half the time with payees_pkey constraint violation.

There is nothing else going on in the database server, and the failure
occurs both when the query comes through Npgsql (where I first saw this) and
through pgAdmin.

The same database has another table with the same basic structure that also
has the same problem.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Kouhei Sutou 2015-07-21 07:31:30 Re: BUG #13500: Windows binary zip doesn't include libintl.h
Previous Message Tom Lane 2015-07-20 17:48:48 Re: [BUGS] object_classes array is broken, again