gpt4 book ai didi

postgresql - 扩展存在但 uuid_generate_v4 失败

转载 作者:行者123 更新时间:2023-11-29 11:05:50 24 4
gpt4 key购买 nike

在亚马逊 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)

如您所见,uuid-ossp 扩展确实存在。但是,当我调用生成 uuid_v4 的函数时,它失败了:

CREATE TABLE my_table (
id uuid DEFAULT uuid_generate_v4() NOT NULL,
name character varying(32) NOT NULL,

);

这是怎么回事?

最佳答案

该扩展可用但未安装在此数据库中。

CREATE EXTENSION IF NOT EXISTS "uuid-ossp";

关于postgresql - 扩展存在但 uuid_generate_v4 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22446478/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com