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

From Hiroshi Saito
Subject Re: BUG #4167: When generating UUID using UUID-OSSP module, UUIDs are not unique on Windows
Date
Msg-id 4B314E2E6F004CDA902B1F3B8A34F33F@HIRO57887DE653
Whole thread Raw
In response to Re: BUG #4167: When generating UUID using UUID-OSSP module, UUIDs are not unique on Windows  ("Hiroshi Saito" <z-saito@guitar.ocn.ne.jp>)
List 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';

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #4523: TO_CHAR function : the ".US" format returns incorrect value
Next
From: "chris wood"
Date:
Subject: BUG #4525: substring with this pattern works in 8.3.1; does not work in 8.3.4