CREATE TABLE users (
id UUID NOT NULL DEFAULT uuid_generate_v4() PRIMARY KEY,
username varchar(255) NOT NULL,
password char(128) NOT NULL,
phone varchar(255) NOT NULL
);
-- 索引
CREATE INDEX index_users_on_username on users (username);
-- 唯一
CREATE UNIQUE INDEX index_users_on_phone on users (phone);
create extension "uuid-ossp" ;
select uuid_generate_v4()
原文:https://www.cnblogs.com/liangyy/p/13065878.html