Re: huh!? - Mailing list pgsql-bugs

From Tom Lane
Subject Re: huh!?
Date
Msg-id 27535.1017779557@sss.pgh.pa.us
Whole thread Raw
In response to huh!?  ("Vlad Marchenko" <vlad@infonet.com.ua>)
List pgsql-bugs
"Vlad Marchenko" <vlad@infonet.com.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

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Solaris 8 install of postgres 7.2
Next
From: Tom Lane
Date:
Subject: Re: SEGV in contrib/array/array_iterator.c