pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
duplicate key violates unique constraint pg_toast_635216540
9+ messages / 4 participants
[nested] [flat]

* duplicate key violates unique constraint pg_toast_635216540
@ 2006-10-16 16:16  Paul Laughlin <plaughlin@gmail.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Paul Laughlin @ 2006-10-16 16:16 UTC (permalink / raw)
  To: pgsql-bugs

Hi,

For the last 6 months or so we've had an intermittent issue while doing a
data import with a simple update statement.  The fix that we've found for
this issue is to REINDEX TABLE <tablename>;


Has anyone seen this error before?

Again, the error is: duplicate key violates unique constraint pg_toast_<>

Thanks,

Paul

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

* Re: duplicate key violates unique constraint pg_toast_635216540
@ 2006-10-16 16:25  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Paul Laughlin <plaughlin@gmail.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Tom Lane @ 2006-10-16 16:25 UTC (permalink / raw)
  To: Paul Laughlin <plaughlin@gmail.com>; +Cc: pgsql-bugs

"Paul Laughlin" <plaughlin@gmail.com> writes:
> For the last 6 months or so we've had an intermittent issue while doing a
> data import with a simple update statement.  The fix that we've found for
> this issue is to REINDEX TABLE <tablename>;

What PG version is this?

Are you sure that the REINDEX actually does anything, as opposed to
merely retrying the data import?  I'm thinking you may be having
problems with OID collisions after OID wraparound, which is something
8.1 should defend against but no earlier version does.

What do you get from
	select count(distinct chunk_id) from pg_toast.pg_toast_635216540 ;

			regards, tom lane



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

* Re: duplicate key violates unique constraint pg_toast_635216540
@ 2006-10-16 16:45  Paul Laughlin <plaughlin@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 9+ messages in thread

From: Paul Laughlin @ 2006-10-16 16:45 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs

warehouse=# select count(distinct chunk_id) from
pg_toast.pg_toast_635216540;
count
-------
74557
(1 row)

We're on version 8.0.7

On 10/16/06, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> "Paul Laughlin" <plaughlin@gmail.com> writes:
> > For the last 6 months or so we've had an intermittent issue while doing
> a
> > data import with a simple update statement.  The fix that we've found
> for
> > this issue is to REINDEX TABLE <tablename>;
>
> What PG version is this?
>
> Are you sure that the REINDEX actually does anything, as opposed to
> merely retrying the data import?  I'm thinking you may be having
> problems with OID collisions after OID wraparound, which is something
> 8.1 should defend against but no earlier version does.
>
> What do you get from
>         select count(distinct chunk_id) from pg_toast.pg_toast_635216540 ;
>
>                         regards, tom lane
>

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

* Re: duplicate key violates unique constraint pg_toast_635216540
@ 2006-10-16 16:51  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Paul Laughlin <plaughlin@gmail.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Tom Lane @ 2006-10-16 16:51 UTC (permalink / raw)
  To: Paul Laughlin <plaughlin@gmail.com>; +Cc: pgsql-bugs

"Paul Laughlin" <plaughlin@gmail.com> writes:
> warehouse=# select count(distinct chunk_id) from
> pg_toast.pg_toast_635216540;
> count
> -------
> 74557
> (1 row)

> We're on version 8.0.7

Well, 8.0 is definitely at risk for OID collisions in a toast table,
but with so few entries I'd have thought the probability pretty low.
How often do you see these errors?

			regards, tom lane



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

* Re: duplicate key violates unique constraint pg_toast_635216540
@ 2006-10-16 17:01  Paul Laughlin <plaughlin@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 9+ messages in thread

From: Paul Laughlin @ 2006-10-16 17:01 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs

We got it early last week and again this morning.  Before these two it was
about six months ago.

On 10/16/06, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> "Paul Laughlin" <plaughlin@gmail.com> writes:
> > warehouse=# select count(distinct chunk_id) from
> > pg_toast.pg_toast_635216540;
> > count
> > -------
> > 74557
> > (1 row)
>
> > We're on version 8.0.7
>
> Well, 8.0 is definitely at risk for OID collisions in a toast table,
> but with so few entries I'd have thought the probability pretty low.
> How often do you see these errors?
>
>                         regards, tom lane
>

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

* Re: duplicate key violates unique constraint pg_toast_635216540
@ 2006-10-16 17:04  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Paul Laughlin <plaughlin@gmail.com>
  0 siblings, 0 replies; 9+ messages in thread

From: Tom Lane @ 2006-10-16 17:04 UTC (permalink / raw)
  To: Paul Laughlin <plaughlin@gmail.com>; +Cc: pgsql-bugs

"Paul Laughlin" <plaughlin@gmail.com> writes:
> We got it early last week and again this morning.  Before these two it was
> about six months ago.

A certain amount of clustering could be expected, if a lot of the
entries were made at the time of initial table load --- they'd have
nearby OIDs.  You can either ignore it (I doubt you need REINDEX, just
retry the update) or else update to PG 8.1 ...

			regards, tom lane



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

* Duplicate key violates unique constraint
@ 2013-12-20 11:38  Umesh Kirdat <umesh.kirdat@yahoo.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Umesh Kirdat @ 2013-12-20 11:38 UTC (permalink / raw)
  To: pgsql-bugs; pgsql-bugs

Hello All,
 
I have been using pg_dump/pg_restore to backup and restore the database in our product for quite sometime.
One of our customers reported an issue with multiple entries for a field marked as primary key.
 
After investigation of the logs we found the multiple entires were created during pg_restore and the primary key constraint on the field could not be created due to unique constraint violation.
 
After searching on internet I came across the Postgres BUG 8382 & 3231 & 7760 reported in the past for this issue.
 
The Postgres version on which the issue was reported is 8.2.2
We have upgraded our Postgres version to 9.0.4 in the current product release and I would like to know whether the issue in discussion is fixed in Postgres 9.0.4?
 
Thank you,
Umesh Kirdat

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

* Re: Duplicate key violates unique constraint
@ 2013-12-21 01:11  Greg Stark <stark@mit.edu>
  parent: Umesh Kirdat <umesh.kirdat@yahoo.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Greg Stark @ 2013-12-21 01:11 UTC (permalink / raw)
  To: Umesh Kirdat <umesh.kirdat@yahoo.com>; +Cc: pgsql-bugs

On Fri, Dec 20, 2013 at 11:38 AM, Umesh Kirdat <umesh.kirdat@yahoo.com> wrote:
> The Postgres version on which the issue was reported is 8.2.2
> We have upgraded our Postgres version to 9.0.4 in the current product
> release and I would like to know whether the issue in discussion is fixed in
> Postgres 9.0.4?


When there's any sort of, thankfully rare, corruption bug the symptom
which people first notice is often duplicate primary keys. So your
question is really whether 9.0.4 is free of any (known) corruption
bugs.

For what it's worth the current release for the 9.0 major version is
9.0 is 9.0.15. There are over 2 1/2 years of bug fixes between 9.0.4
and 9.0.15 including some corruption bugs which could possibly
introduce duplicate rows. Also including one major security fix for
CVE-2013-1899.



-- 
greg


-- 
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] 9+ messages in thread

* Re: Duplicate key violates unique constraint
@ 2014-01-14 06:50  Umesh Kirdat <umesh.kirdat@yahoo.com>
  parent: Greg Stark <stark@mit.edu>
  0 siblings, 0 replies; 9+ messages in thread

From: Umesh Kirdat @ 2014-01-14 06:50 UTC (permalink / raw)
  To: Greg Stark <stark@mit.edu>; +Cc: pgsql-bugs

Thank you Greg for the response.
 
Our management wants to know whether the bugs 8382 & 3231 & 7760 are fixed in 9.0.15 before we decide to upgrade from 9.0.4 version to 9.0.15.
 
It would be helpful to convience our customers who has reported the issue.
 
Thank you,
Umesh



On Saturday, 21 December 2013 6:42 AM, Greg Stark <stark@mit.edu> wrote:
  
On Fri, Dec 20, 2013 at 11:38 AM, Umesh Kirdat <umesh.kirdat@yahoo.com> wrote:

> The Postgres version on which the issue was reported is 8.2.2
> We have upgraded our Postgres version to 9.0.4 in the current product
> release and I would like to know whether the issue in discussion is fixed in
> Postgres 9.0.4?


When there's any sort of, thankfully rare, corruption bug the symptom
which people first notice is often duplicate primary keys. So your
question is really whether 9.0.4 is free of any (known) corruption
bugs.

For what it's worth the current release for the
 9.0 major version is
9.0 is 9.0.15. There are over 2 1/2 years of bug fixes between 9.0.4
and 9.0.15 including some corruption bugs which could possibly
introduce duplicate rows. Also including one major security fix for
CVE-2013-1899.



-- 
greg

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


end of thread, other threads:[~2014-01-14 06:50 UTC | newest]

Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-10-16 16:16 duplicate key violates unique constraint pg_toast_635216540 Paul Laughlin <plaughlin@gmail.com>
2006-10-16 16:25 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-10-16 16:45   ` Paul Laughlin <plaughlin@gmail.com>
2006-10-16 16:51     ` Tom Lane <tgl@sss.pgh.pa.us>
2006-10-16 17:01       ` Paul Laughlin <plaughlin@gmail.com>
2006-10-16 17:04         ` Tom Lane <tgl@sss.pgh.pa.us>
2013-12-20 11:38 Duplicate key violates unique constraint Umesh Kirdat <umesh.kirdat@yahoo.com>
2013-12-21 01:11 ` Re: Duplicate key violates unique constraint Greg Stark <stark@mit.edu>
2014-01-14 06:50   ` Re: Duplicate key violates unique constraint Umesh Kirdat <umesh.kirdat@yahoo.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