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

Re: huh!?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Vlad Marchenko" <vlad(at)infonet(dot)com(dot)ua>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: huh!?
Date: 2002-04-02 20:32:37
Message-ID: 27535.1017779557@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"Vlad Marchenko" <vlad(at)infonet(dot)com(dot)ua> writes:
> test=# select count(*) from subscribers;
>  count
> -------
>  96856
> (1 row)

> test=# select * from subscribers where email~'domain4';
>  sid | email | domain | status | password | signup | name | sex | address |
> city | state | zip | country | phone
> -----+-------+--------+--------+----------+--------+------+-----+---------+-
> -----+-------+-----+---------+-------
> (0 rows)

> test=# INSERT INTO subscribers(email) SELECT (random()||'@domain4.com') from
> subscribers;
> ERROR:  Cannot insert a duplicate key into unique index
> subscribers_email_key
> test=#

> I assume that this is because of pure transaction data isolation?

No, this just says that when you generated 96856 random() values, you got
at least one pair of duplicates.

			regards, tom lane

In response to

  • huh!? at 2002-03-29 12:18:53 from Vlad Marchenko

pgsql-bugs by date

Next:From: Tom LaneDate: 2002-04-02 20:54:18
Subject: Re: SEGV in contrib/array/array_iterator.c
Previous:From: Tom LaneDate: 2002-04-02 20:29:30
Subject: Re: Solaris 8 install of postgres 7.2

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