赞
踩
事前准备test表,DDL如下:
CREATE TABLE zzz_test.test (
id uuid NOT NULL, -- 主键id
"name" varchar NULL -- 测试值
);
-- Column comments
COMMENT ON COLUMN zzz_test.test.id IS '主键id';
COMMENT ON COLUMN zzz_test.test."name" IS '测试值';
方法一:
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
insert into zzz_test.test values(uuid_generate_v4(),'valueV1')
方法二:
CREATE EXTENSION IF NOT EXISTS "pgcrypto";
insert into zzz_test.test values(gen_random_uuid(),'valueV2')
查看结果:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。