PostgreSQL: Working with Universally Unique Identifier – UUID Data type

The PostgreSQL provides Universally Unique Identifier -UUID data type and related functions.

In the previous post, I have already shared the truth about Universally Unique Identifier - UUID.
You can visit this article here.

PostgreSQL provides two extensions.
1. uuid-ossp 2. pgcrypto.

You can install this extension using this script.

I am using pgcrypto extension for generating a UUID.

Below is a small demonstration:
Generate UUID using gen_random_uuid():

Create a sample table with UUID Data type:

Insert sample data:

The Result:

PostgreSQL UUID

Anvesh Patel

Leave a Reply

3 Comments on "PostgreSQL: Working with Universally Unique Identifier – UUID Data type"

Notify of
avatar
Sort by:   newest | oldest | most voted
Nagan
Guest

Respect to author, some fantastic selective information.

Kruti
Guest

You made certain nice points there. I did a search on the issue and found nearly all persons will consent with your blog.

trackback

Great post anvesh…..

wpDiscuz