1

As part of a project, I need to cast a UUID as int on postgresql.

Do you have any idea how to do this?

Thanks in advance

Enileme
  • 11
  • 2
  • 3
    That's not possible. An uuid has a much bigger range of values than can fit into an integer. It won't even fit into a bigint. –  Aug 18 '20 at 07:36
  • 1
    What you can do, is to convert it to numeric, as the uuid is essentially a hex string (if you remove the `-` from it). See e.g. [here](https://stackoverflow.com/questions/33486595/) –  Aug 18 '20 at 07:49

0 Answers0