0 votes
1 view
in AWS by (19.2k 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.6k 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";

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...