DEV Community

Weerayut Teja
Weerayut Teja

Posted on

How to deal with : Function uuid_generate_v4() does not exist on PostgreSQL

Some time when you create the table on PostgreSQL and want to use UUID Generator V4 on uuid field but turn out that you got this error.

Function uuid_generate_v4() does not exist
Enter fullscreen mode Exit fullscreen mode

To resolve this problem, just run this command in the SQL Editor

CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
Enter fullscreen mode Exit fullscreen mode

Note: you also need to have uuid-ossp.control extension to be available provided by postgresql-contrib package

Top comments (4)

Collapse
 
farhan_nazmul_26526fb76d1 profile image
Farhan Nazmul

thanks

Collapse
 
smartdriver321 profile image
smartdriver321

Thanks. it's helpfull

Collapse
 
rodrigo_vincius_6e1b72bf profile image
Rodrigo Vinícius

Worked like a charm! Thanks!

Collapse
 
ayyoub_jadoo_08539104e1f0 profile image
Ayyoub Jadoo

Thank you