Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in AWS by (19.1k points)

At amazon ec2 RDS Postgresql:

=> SHOW rds.extensions;

rds.extensions                                   

----------------------------------------------------------

 btree_gin,btree_gist,chkpass,citext,cube,dblink,dict_int,dict_xsyn,earthdistance,fuzzystrmatch,hstore,intagg,intarray,isn,ltree,pgcrypto,pgrowlocks,pg_trgm,plperl,plpgsql,pltcl,postgis,postgis_tiger_geocoder,postgis_topology,sslinfo,tablefunc,tsearch2,unaccent,uuid-ossp

(1 row)

As you can see, uuid-ossp extension does exist. However, when I'm calling the function for generation uuid_v4, it fails:

CREATE TABLE my_table (

    id uuid DEFAULT uuid_generate_v4() NOT NULL,

    name character varying(32) NOT NULL,

);

What's wrong with this?

1 Answer

0 votes
by (44.3k points)

Install the available extension using the below command. Also, mention IF NOT EXISTS because it might show an existing error.

CREATE EXTENSION IF NOT EXISTS "uuid-ossp";

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
0 votes
1 answer

Browse Categories

...