Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
Could anyone help on how to create a column with uuid generator field which would generate random numbers automatically while inserting the row.
uuid
uuidv7
If you install the uuid-ossp extension, you can e.g. use uuid_generate_v4() for the default value of such a column:
uuid-ossp
uuid_generate_v4()
create table selva ( uid uuid default uuid_generate_v4(), ... other columns .. );
Add a comment
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
uuidv7for a Version 7 UUID value that enables efficient indexing. See my Answer on the original of this duplicate Question.