我有下表:
CREATE TABLE word(
word CHARACTER VARYING NOT NULL,
id BIGINT NOT NULL,
repeat INTEGER NOT NULL
);
ALTER TABLE public.word OWNER TO postgres;
ALTER TABLE ONLY word ADD CONSTRAINT "ID_PKEY" PRIMARY KEY (word,id);
Run Code Online (Sandbox Code Playgroud)
当我尝试使用以下命令恢复它时:
psql -U postgres -h localhost -d word -f word.sql
Run Code Online (Sandbox Code Playgroud)
它给了我这个错误:
不允许表“word”的多个主键
如何在 postgres 中使用多个主键?