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

Re: BUG #4167: When generating UUID using UUID-OSSP module, UUIDs are not unique on Windows

From: "Hiroshi Saito" <z-saito(at)guitar(dot)ocn(dot)ne(dot)jp>
To: <pgsql-bugs(at)postgresql(dot)org>
Cc: "Ismael Ciordia, Openbravo" <ismael(dot)ciordia(at)openbravo(dot)com>
Subject: Re: BUG #4167: When generating UUID using UUID-OSSP module, UUIDs are not unique on Windows
Date: 2008-11-12 16:15:28
Message-ID: 4B314E2E6F004CDA902B1F3B8A34F33F@HIRO57887DE653 (view raw or flat)
Thread:
Lists: pgsql-bugs
Ooops, It will be helpful to a user. 
Therefore,  it transmits here.:-)
Thanks!!

--  copy --
Hi Hiroshi-san,

if you want you can include the function we have used to test the problem,
pasted below.

Regards,

Ismael

**************

CREATE OR REPLACE FUNCTION test_uuidgen(countmax INTEGER) RETURNS character
varying AS
$BODY$
DECLARE
  countmin INTEGER := 1;
  distinctuuid bigint;
  v_message VARCHAR(2000) := '';

BEGIN
    drop table if exists uuid_gen;
    CREATE TABLE uuid_gen
    (
      uuid_gen_col uuid NOT NULL

    );
    LOOP
        INSERT INTO uuid_gen (uuid_gen_col) VALUES (uuid_generate_v1());
        countmin := countmin + 1;
        EXIT WHEN countmin > countmax;
    END LOOP;
    SELECT COUNT(DISTINCT uuid_gen_col) INTO distinctuuid FROM uuid_gen;
    IF distinctuuid <> countmax THEN
        v_message := 'Repeated UUID: FAILS';
    ELSE
        v_message := 'NO repeated UUID: OK';
    END IF;
    RETURN v_message;
END;
$BODY$  LANGUAGE 'plpgsql';


In response to

pgsql-bugs by date

Next:From: Chris WoodDate: 2008-11-12 18:07:46
Subject: substring with this pattern works in 8.3.1; does not work in 8.3.4
Previous:From: Tom LaneDate: 2008-11-12 16:09:21
Subject: Re: BUG #4523: TO_CHAR function : the ".US" format returns incorrect value

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