Re: [HACKERS] Need help understanding unique indices (fwd)

Vadim Mikheev <vadim@krs.ru>

From: Vadim Mikheev <vadim@krs.ru>
To: Marc Howard Zuckman <marc@fallon.classyad.com>
Cc: "Jackson, DeJuan" <djackson@cpsgroup.com>, pgsql-hackers@postgreSQL.org
Date: 1998-06-19T14:47:47Z
Lists: pgsql-hackers
Marc Howard Zuckman wrote:
> 
> While this query makes just as much sense as the ones that I tried,
> it also fails on my database.  Once again, I do not understand why.
> Bug???
> 
> realestate=> begin;
> BEGIN
> realestate=> INSERT INTO propsales
> realestate-> SELECT n.*
> realestate->   FROM newpropsales AS n
> realestate->  WHERE NOT EXISTS (SELECT p.*
> realestate->                      FROM propsales AS p
> realestate->                     WHERE n.city = p.city AND
> realestate->                           n.street = p.street AND
> realestate->                           n.streetno = p.streetno AND
> realestate->                           n.county = p.county AND
> realestate->                           n.closingdate = p.closingdate);
> ERROR:  Cannot insert a duplicate key into a unique index

I can't reproduce this! (6.3.2 on Solaris 2.5 (sparc),
6.4-current on FreeBSD 2.2.6)

Vadim