Frage

I know that PostgreSQL 9+ has module to generate UUID. But after a lot of search I couldn't find any solution to generate UUID in PostgreSQL 8.2. I also need to keep this version because lot of my customers are still using 8.2. I am thinking to use current Timestamp as UUID.

Running select extract(epoch from now()); query and getting a Timestamp like 1384396600.53923. I want to store it as character and use as UUID. Is there any possibility of generating duplicate Timestamp? Also will it be feasible to use Timestamp as UUID?

War es hilfreich?

Lösung

i am not sure it is feasible. but i suggest you not to use the Timestamp as UUID.

i don't konw how large concurrent your condition is. if you are in a very much large concurrent condition,or in a very extreme condition by chance,i think it must will be give you two same Timestamp,so there will be something wrong,right?

so,use some other way to make a "UUID".

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top