DEV Community

Discussion on: Generate UUID fields in Phoenix with Postgresql

Collapse
 
rhymes profile image
rhymes • Edited

Cool!

Consider using gen_random_uuid() instead of uuid_generate_v4 if you only need UUIDv4 ids (we shouldn't use the other pseudo random generators anyway, but that's another story :D).

I admit I'm not 100% sure of the difference (the latter is in pgcrypto) but gen_random_uuid() seems to be faster: jasonaowen.net/blog/2017/Apr/13/be...