The object for windows can be used from Version 1.6.2. (+patch)
http://www.ossp.org/pkg/lib/uuid/
--
Great developer: Ralf S. Engelschall
Note: Please apply patch.(update:2008.08.24)
patch -p0 <uuid-1.6.2_win32_patch2
How to build.:
1. Deployment of tar.gz
2. apply the patch
3. configure and build by Linux or MinGW
4. config.h and win32.mak are set at the head of a source tree.
5. nmake -f win32.mak
-- run test --
postgres=# SELECT uuid_generate_v3(uuid_ns_url(), 'http://www.postgresql.org');
uuid_generate_v3
--------------------------------------
cf16fe52-3365-3a1f-8572-288d8d2aaa46
--
and,
--
-- ossp-uuid test
--
CREATE OR REPLACE FUNCTION test_uuid(gen INTEGER)
RETURNS VOID AS $$
BEGIN
FOR i IN 1..$1 LOOP
RAISE INFO 'uuid = %', uuid_generate_v4();
END LOOP;
END;
$$
LANGUAGE 'plpgsql';
postgres=# 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 = %', uuid_generate_v4();
postgres$# END LOOP;
postgres$# END;
postgres$# $$
postgres-# LANGUAGE 'plpgsql';
CREATE FUNCTION
postgres=# SELECT test_uuid(10);
INFO: uuid = 427c6f3e-9876-48c5-b44d-776771f7c2c9
INFO: uuid = fbab93a8-44d2-4f52-b6ae-01396c6ee17e
INFO: uuid = d82be630-d2e8-4662-b6ea-db8c56121024
INFO: uuid = 33689404-2da8-4a8d-9b94-6aeb284be347
INFO: uuid = cd7d10b7-23fa-40df-af74-53314dae235c
INFO: uuid = 80934b57-4cf4-4ab5-b915-f41f22054265
INFO: uuid = abd6f205-1a49-4f4f-b854-c7d611533401
INFO: uuid = 2dd64cbc-ee86-419e-ba09-ae538f60cc5a
INFO: uuid = 751ee0fe-d5ae-473f-b22f-e14c9066fadd
INFO: uuid = 0d36e47d-c065-4717-96f0-82f53f610a9a
test_uuid
-----------
(1 row)
Hiroshi Saito(hiroshi@winpg.jp)