PostgreSQL Error: Relation already exists

后端 未结 8 1819
暖寄归人
暖寄归人 2020-12-05 12:37

I am trying to create a table that was dropped previously.

But when I do the CREATE TABLE A ... I am getting below error:

Rela

8条回答
  •  -上瘾入骨i
    2020-12-05 13:16

    I finally discover the error. The problem is that the primary key constraint name is equal the table name. I don know how postgres represents constraints, but I think the error "Relation already exists" was being triggered during the creation of the primary key constraint because the table was already declared. But because of this error, the table wasnt created at the end.

提交回复
热议问题