Re: uniqueness not always correct

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Vadim Mikheev <vadim(at)krs(dot)ru>
Cc: Frank Cusack <fcusack(at)iconnet(dot)net>, pgsql-bugs(at)postgreSQL(dot)org, PostgreSQL Developers List <hackers(at)postgreSQL(dot)org>
Subject: Re: uniqueness not always correct
Date: 2000-05-31 23:28:54
Message-ID: 200005312328.TAA04113@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

This is Vadim's comment on the bug.

> Frank Cusack wrote:
> >
> > Solaris 2.6/sparc; postgres 6.5.1
> >
> > dns=> create table test (zone int4, net cidr, unique(zone, net));
> > NOTICE: CREATE TABLE/UNIQUE will create implicit index 'test_zone_key' for table 'test'
> > CREATE
> > dns=> insert into test (zone, net) values (1, '1.2.3/24');
> > INSERT 21750 1
> > dns=> insert into test (zone, net) values (1, '2.3.4/24');
> > INSERT 21751 1
> > dns=> insert into test (zone, net) values (1, '1.2.3/24');
> > INSERT 21752 1
> > dns=> insert into test (zone, net) values (1, '2.3.4/24');
> > ERROR: Cannot insert a duplicate key into a unique index
>
> Yes, I reproduced this (Solaris 2.5/sparc).
> Seems like CIDR problem(??!):
>
> ais=> create table test (zone int4, net int4, unique(zone, net));
> ^^^^
> NOTICE: CREATE TABLE/UNIQUE will create implicit index 'test_zone_key' for table 'test'
> CREATE
> ais=> insert into test (zone, net) values (1, 1);
> INSERT 7712479 1
> ais=> insert into test (zone, net) values (1, 2);
> INSERT 7712480 1
> ais=> insert into test (zone, net) values (1, 1);
> ERROR: Cannot insert a duplicate key into a unique index
>
> Vadim
>
> ************
>
>

--
Bruce Momjian | http://www.op.net/~candle
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2000-06-01 01:21:07 Re: Bug in Create sequence parsing?
Previous Message Bruce Momjian 2000-05-31 23:28:34 Re: uniqueness not always correct

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2000-05-31 23:51:42 pg_am.amowner
Previous Message Bruce Momjian 2000-05-31 23:28:34 Re: uniqueness not always correct