Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate uuid in windows postgresql

I have a postgresql 9 installation on windows, which doesn't have built in uuid generator. There is OSSD package, which can be bound to postgresql as uuid generator, but it's for *nix only (I think).

How can I generate uuid in windows postgresql?

like image 935
Endy Tjahjono Avatar asked Nov 12 '10 09:11

Endy Tjahjono


People also ask

Can Postgres generate UUID?

Unfortunately, while PostgreSQL is great for storing and comparing UUID data, it lacks capabilities for creating UUID values in its core. Instead, it relies on third-party modules to create UUIDs using specified techniques.

Is UUID auto generated?

Any time a row is inserted into this table, the id value will be an auto-generated UUID.

What is Postgres UUID?

What is the Postgres UUID Type? The Postgres UUID data type stores UUIDs as defined by RFC 4122, which are 128-bit quantities generated by algorithms that minimize the probability of having duplicate identifiers. A UUID comprises of 32 hexadecimal digits, represented in groups of 8,4,4,4 and 12.

What is UUID-OSSP extension?

The uuid-ossp module provides functions to generate universally unique identifiers (UUIDs) using one of several standard algorithms. There are also functions to produce certain special UUID constants. This module is only necessary for special requirements beyond what is available in core PostgreSQL.


2 Answers

The one-click installer from EnterpriseDB does have it. The DLL is called "uuid-ossp.dll" and resides in "(Postgres' installation directory)\lib" and the installation SQL script is called "uuid-ossp.sql" and resides in "(Postgres' installation directory)\share\contrib". You have to execute the last one in the DB of your choice.

like image 90
Milen A. Radev Avatar answered Oct 06 '22 00:10

Milen A. Radev


The uuid-ossp-module in the contrib, does work on Windows XP 32 bits. The 64 bits version is not available yet, the OSSP UUID library project has to fix this problem.

like image 37
Frank Heikens Avatar answered Oct 05 '22 23:10

Frank Heikens