Re: BUG #4274: uuid returns duplicate values - Mailing list pgsql-bugs
From | Eric P. Melbardis |
---|---|
Subject | Re: BUG #4274: uuid returns duplicate values |
Date | |
Msg-id | EF3FC357692A7A418A0D4CA7ACE7F4F20296BA38@mail.netkitsolutions.com Whole thread Raw |
In response to | Re: BUG #4274: uuid returns duplicate values ("Hiroshi Saito" <z-saito@guitar.ocn.ne.jp>) |
List | pgsql-bugs |
Hi I would suspect that the clock used may not be precise enough Not with standing, why not use the windows CreateUUID?? Slower system seems to fare better... (please see results below) Regards Eric ------------------- My office system is xeon (duo core 5160) 3.00 ghz, 2 gig-ram psql:q.sql:168: INFO: uuid =3D b2631eb7-26ad-4b40-9276-ed1fc43f0944 psql:q.sql:168: INFO: uuid =3D 45472e3e-a88e-46ff-b2b1-cfa229b8c568 psql:q.sql:168: INFO: uuid =3D 45472e3e-a88e-46ff-b2b1-cfa229b8c568 psql:q.sql:168: INFO: uuid =3D 45472e3e-a88e-46ff-b2b1-cfa229b8c568 psql:q.sql:168: INFO: uuid =3D 45472e3e-a88e-46ff-b2b1-cfa229b8c568 psql:q.sql:168: INFO: uuid =3D 45472e3e-a88e-46ff-b2b1-cfa229b8c568 psql:q.sql:168: INFO: uuid =3D 45472e3e-a88e-46ff-b2b1-cfa229b8c568 psql:q.sql:168: INFO: uuid =3D 45472e3e-a88e-46ff-b2b1-cfa229b8c568 psql:q.sql:168: INFO: uuid =3D efd009ab-c38b-4efa-8b0c-4ef0280dc781 psql:q.sql:168: INFO: uuid =3D 10c8c7aa-1367-44fa-ac76-a0f9b1ca69b7 psql:q.sql:168: INFO: uuid =3D 10c8c7aa-1367-44fa-ac76-a0f9b1ca69b7 psql:q.sql:168: INFO: uuid =3D 10c8c7aa-1367-44fa-ac76-a0f9b1ca69b7 psql:q.sql:168: INFO: uuid =3D 10c8c7aa-1367-44fa-ac76-a0f9b1ca69b7 psql:q.sql:168: INFO: uuid =3D 10c8c7aa-1367-44fa-ac76-a0f9b1ca69b7 psql:q.sql:168: INFO: uuid =3D 10c8c7aa-1367-44fa-ac76-a0f9b1ca69b7 psql:q.sql:168: INFO: uuid =3D 10c8c7aa-1367-44fa-ac76-a0f9b1ca69b7 psql:q.sql:168: INFO: uuid =3D 10c8c7aa-1367-44fa-ac76-a0f9b1ca69b7 psql:q.sql:168: INFO: uuid =3D 10c8c7aa-1367-44fa-ac76-a0f9b1ca69b7 psql:q.sql:168: INFO: uuid =3D abc4884d-273e-49ce-82aa-46226af549c3 psql:q.sql:168: INFO: uuid =3D 5d5fce48-987a-46e9-ac03-e567e703aafb psql:q.sql:168: INFO: uuid =3D 5d5fce48-987a-46e9-ac03-e567e703aafb psql:q.sql:168: INFO: uuid =3D 5d5fce48-987a-46e9-ac03-e567e703aafb psql:q.sql:168: INFO: uuid =3D 5d5fce48-987a-46e9-ac03-e567e703aafb psql:q.sql:168: INFO: uuid =3D 5d5fce48-987a-46e9-ac03-e567e703aafb psql:q.sql:168: INFO: uuid =3D 5d5fce48-987a-46e9-ac03-e567e703aafb psql:q.sql:168: INFO: uuid =3D 5d5fce48-987a-46e9-ac03-e567e703aafb psql:q.sql:168: INFO: uuid =3D 5d5fce48-987a-46e9-ac03-e567e703aafb psql:q.sql:168: INFO: uuid =3D 5d5fce48-987a-46e9-ac03-e567e703aafb psql:q.sql:168: INFO: uuid =3D 5d5fce48-987a-46e9-ac03-e567e703aafb psql:q.sql:168: INFO: uuid =3D 6c3da39d-467e-484c-9b68-6a20f8980c3a psql:q.sql:168: INFO: uuid =3D 6c3da39d-467e-484c-9b68-6a20f8980c3a psql:q.sql:168: INFO: uuid =3D 6c3da39d-467e-484c-9b68-6a20f8980c3a psql:q.sql:168: INFO: uuid =3D 6c3da39d-467e-484c-9b68-6a20f8980c3a psql:q.sql:168: INFO: uuid =3D 6c3da39d-467e-484c-9b68-6a20f8980c3a psql:q.sql:168: INFO: uuid =3D 6c3da39d-467e-484c-9b68-6a20f8980c3a psql:q.sql:168: INFO: uuid =3D 6c3da39d-467e-484c-9b68-6a20f8980c3a psql:q.sql:168: INFO: uuid =3D 6c3da39d-467e-484c-9b68-6a20f8980c3a psql:q.sql:168: INFO: uuid =3D 754268bc-411d-48dd-b68d-5b449c18ecab psql:q.sql:168: INFO: uuid =3D a0ae6b93-adec-4523-b422-8eba041d76de ----- ------------------- My home system is Pentium D 3.2 hz 2g ram (NON-xeon!) psql:q.sql:168: INFO: uuid =3D 5dce8d5f-0f36-40fc-a34c-af74991e7fb3 psql:q.sql:168: INFO: uuid =3D ae9b28c3-1614-4092-93dd-ba1d8392622c psql:q.sql:168: INFO: uuid =3D ae9b28c3-1614-4092-93dd-ba1d8392622c psql:q.sql:168: INFO: uuid =3D 14146307-231e-4feb-aa97-a709f6515d05 psql:q.sql:168: INFO: uuid =3D 6a70d36c-de75-44ca-947b-3785eac42d49 psql:q.sql:168: INFO: uuid =3D 6a70d36c-de75-44ca-947b-3785eac42d49 psql:q.sql:168: INFO: uuid =3D 849650aa-1004-4c28-b7b5-dce9bcff22e4 psql:q.sql:168: INFO: uuid =3D f950d8d9-c257-41cc-8206-7267698755f1 psql:q.sql:168: INFO: uuid =3D f950d8d9-c257-41cc-8206-7267698755f1 psql:q.sql:168: INFO: uuid =3D f950d8d9-c257-41cc-8206-7267698755f1 psql:q.sql:168: INFO: uuid =3D df203405-a3d9-40b8-8195-46cdc7a9aa09 psql:q.sql:168: INFO: uuid =3D c7ac43bc-2355-4c4d-9b61-defefead41e1 psql:q.sql:168: INFO: uuid =3D c7ac43bc-2355-4c4d-9b61-defefead41e1 psql:q.sql:168: INFO: uuid =3D e6a40257-5095-441a-8216-4802b8ccceca psql:q.sql:168: INFO: uuid =3D d10df458-a372-4ff8-85f5-c6fb8bcdf798 psql:q.sql:168: INFO: uuid =3D d10df458-a372-4ff8-85f5-c6fb8bcdf798 psql:q.sql:168: INFO: uuid =3D d10df458-a372-4ff8-85f5-c6fb8bcdf798 psql:q.sql:168: INFO: uuid =3D 3ff3189b-cbe9-4e7f-b76e-0953337242b1 psql:q.sql:168: INFO: uuid =3D 210a9418-1e19-4bec-b7ca-a0333d7dbb02 psql:q.sql:168: INFO: uuid =3D 210a9418-1e19-4bec-b7ca-a0333d7dbb02 psql:q.sql:168: INFO: uuid =3D 68bfec27-6f9d-49c7-93fc-4218a1d32e18 psql:q.sql:168: INFO: uuid =3D ef86cb1b-2721-4a74-ba21-64fe5148c9d7 psql:q.sql:168: INFO: uuid =3D ef86cb1b-2721-4a74-ba21-64fe5148c9d7 psql:q.sql:168: INFO: uuid =3D ef86cb1b-2721-4a74-ba21-64fe5148c9d7 psql:q.sql:168: INFO: uuid =3D 45141a17-9972-4013-92f2-ced9215f45b5 psql:q.sql:168: INFO: uuid =3D 7c6cbb39-af9f-4de6-b6f8-0ae57bf0ea4f psql:q.sql:168: INFO: uuid =3D 7c6cbb39-af9f-4de6-b6f8-0ae57bf0ea4f psql:q.sql:168: INFO: uuid =3D 59d4c7ff-598d-49ae-9a95-a4051c2b5787 -----Original Message----- From: Hiroshi Saito [mailto:z-saito@guitar.ocn.ne.jp]=20 Sent: Tuesday, July 01, 2008 4:56 PM To: Eric P. Melbardis Cc: pgsql-bugs@postgresql.org Subject: Re: [BUGS] BUG #4274: uuid returns duplicate values Hi. Umm... The test of my box is comfortable.=20 -- -- ossp-uuid test -- CREATE OR REPLACE FUNCTION test_uuid(gen INTEGER) RETURNS VOID AS $$ BEGIN FOR i IN 1..$1 LOOP RAISE INFO 'uuid =3D %', uuid_generate_v4(); END LOOP; END; $$ LANGUAGE 'plpgsql'; postgres=3D# CREATE OR REPLACE FUNCTION test_uuid(gen INTEGER) postgres-# RETURNS VOID AS $$ postgres$# BEGIN postgres$# FOR i IN 1..$1 LOOP postgres$# RAISE INFO 'uuid =3D %', uuid_generate_v4(); postgres$# END LOOP; postgres$# END; postgres$# $$ postgres-# LANGUAGE 'plpgsql'; CREATE FUNCTION postgres=3D# SELECT test_uuid(10); INFO: uuid =3D 427c6f3e-9876-48c5-b44d-776771f7c2c9 INFO: uuid =3D fbab93a8-44d2-4f52-b6ae-01396c6ee17e INFO: uuid =3D d82be630-d2e8-4662-b6ea-db8c56121024 INFO: uuid =3D 33689404-2da8-4a8d-9b94-6aeb284be347 INFO: uuid =3D cd7d10b7-23fa-40df-af74-53314dae235c INFO: uuid =3D 80934b57-4cf4-4ab5-b915-f41f22054265 INFO: uuid =3D abd6f205-1a49-4f4f-b854-c7d611533401 INFO: uuid =3D 2dd64cbc-ee86-419e-ba09-ae538f60cc5a INFO: uuid =3D 751ee0fe-d5ae-473f-b22f-e14c9066fadd INFO: uuid =3D 0d36e47d-c065-4717-96f0-82f53f610a9a test_uuid ----------- (1 row) Regards, Hiroshi Saito ----- Original Message -----=20 From: "Eric P. Melbardis" <eric.melbardis@netkitsolutions.com> Hi I just tried it, slightly better but not a runner.... Here is a sample of the results I get when running my test script, note result vary but lack of duplicates does not. Why do you not use the CreateUUID function in windows?? Regards Eric ------------------------ result ------------------------------------ psql:q.sql:152: NOTICE: uuid =3D dfde33d4-188a-4124-847d-0871a90be1fa psql:q.sql:152: NOTICE: uuid =3D dfde33d4-188a-4124-847d-0871a90be1fa psql:q.sql:152: NOTICE: uuid =3D e6e5dd64-5a1b-4f2e-8443-829d3b325247 psql:q.sql:152: NOTICE: uuid =3D 2bb08ab3-eb57-42a3-a9ac-63e466384d71 -----Original Message----- From: Hiroshi Saito [mailto:z-saito@guitar.ocn.ne.jp]=20 Sent: Sunday, June 29, 2008 3:22 PM To: Eric P. Melbardis Cc: pgsql-bugs@postgresql.org Subject: Re: [BUGS] BUG #4274: uuid returns duplicate values Hi. I'm sorry delaying release bugfix was not included in pg8.3.3.=20 Please try this.=20 http://winpg.jp/~saito/pg_work/OSSP_win32/ Regards, Hiroshi Saito > >The following bug has been logged online: > >Bug reference: 4274 >Logged by: eric melbardis >Email address: eric.melbardis@netkitsolutions.com >PostgreSQL version: 8.3.3 >Operating system: windows xp sp3 >Description: uuid returns duplicate values >Details:=20 > >the uuid functions do not return unique values if used sequntially, or i >believe without too much tme in between invocations. > >the following test functions returns the same value! > >------------ test function --------------- >create or replace function test_uuid() >returns varchar as=20 >$body$ >begin > raise notice 'uuid =3D %', uuid_generate_v4(); > raise notice 'uuid =3D %', uuid_generate_v4(); > raise notice 'uuid =3D %', uuid_generate_v4(); > raise notice 'uuid =3D %', uuid_generate_v4(); >end; >$body$ >language 'plpgsql' ; > >--=20 >Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) >To make changes to your subscription: >http://www.postgresql.org/mailpref/pgsql-bugs
pgsql-bugs by date: