Help Center > > Developer Guide> SQL Reference> Functions and Operators> UUID Functions

UUID Functions

Updated at: Jul 15, 2020 GMT+08:00

UUID functions are used to generate UUID data (see UUID Type).

  • uuid_generate_v1()

    Description: Generates a UUID sequence number.

    Return type: UUID

    Example:

    1
    2
    3
    4
    5
    SELECT uuid_generate_v1();
               uuid_generate_v1           
    --------------------------------------
     c71ceaca-a175-11e9-a920-797ff7000001
    (1 row)
    

    The uuid_generate_v1 function generates UUIDs based on the time information, cluster node ID, and thread ID that generates the sequence. Each UUID is globally unique in a cluster, but there is a low probability that a UUID is duplicated among multiple clusters.

  • sys_guid()

    Description: Generate a sequence number that is the same as the sequence number generated by the Oracle sys_guid method.

    Return type: text

    Example:

    1
    2
    3
    4
    5
    SELECT sys_guid();
                 sys_guid             
    ----------------------------------
     4EBD3C74A17A11E9A1BF797FF7000001
    (1 row)
    

    The data generation principle of the sys_guid function is the same as that of the uuid_generate_v1 function.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel