Skip site navigation (1) Skip section navigation (2)

Re: BUG #2306: Duplicate primary key

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Andreas Jung <lists(at)andreas-jung(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2306: Duplicate primary key
Date: 2006-03-08 20:30:37
Message-ID: 20060308203037.GA56586@winnie.fuhr.org (view raw or flat)
Thread:
Lists: pgsql-bugs
On Tue, Mar 07, 2006 at 04:43:18PM +0000, Andreas Jung wrote:
> PostgreSQL version: 7.4.9

7.4.12 is the latest in that branch; it contains several bug fixes
since 7.4.9.

> This gives me two rows with the same id=5077:
> 
> Toolbox2Test=# select * from hierarchy where id >= 5077 order by id;

What's the output of the following command?

SELECT ctid, xmin, xmax, * FROM hierarchy WHERE id >= 5077 ORDER BY id;

> Search for all rows with id=5077 returns this:
> 
> Toolbox2Test=# select * from hierarchy where id = 5077;
[...]
> (1 row)

Does the same query return different results depending on whether
you use an index scan or a sequential scan?  What do you get for
these queries?

SET enable_seqscan TO on;
SET enable_indexscan TO off;
SELECT ctid, xmin, xmax, * FROM hierarchy WHERE id >= 5077;
SELECT ctid, xmin, xmax, * FROM hierarchy WHERE id = 5077;

SET enable_seqscan TO off;
SET enable_indexscan TO on;
SELECT ctid, xmin, xmax, * FROM hierarchy WHERE id >= 5077;
SELECT ctid, xmin, xmax, * FROM hierarchy WHERE id = 5077;

-- 
Michael Fuhr

In response to

pgsql-bugs by date

Next:From: John R PierceDate: 2006-03-08 20:35:25
Subject: Re: BUG #2305: "No bufferspace available" error on large insert
Previous:From: Matthew GeorgeDate: 2006-03-08 17:13:46
Subject: BUG #2308: pg_dump -a does not respect referential dependencies

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group