我在PostgreSQL中有一张表,其架构如下所示:
CREATE TABLE "foo_table" (
"id" serial NOT NULL PRIMARY KEY,
"permalink" varchar(200) NOT NULL,
"text" varchar(512) NOT NULL,
"timestamp" timestamp with time zone NOT NULL
)
现在,我想通过更改表来使永久链接在整个表中唯一。有人可以帮我吗?
TIA
create unique index on foo_table (permalink)