PostgreSQL Error: Relation already exists

后端 未结 8 1833
暖寄归人
暖寄归人 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:19

    Sometimes this kind of error happens when you create tables with different database users and try to SELECT with a different user. You can grant all privileges using below query.

    GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA schema_name TO username;
    

    And also you can grant access for DML statements

    GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA schema_name TO username;
    

提交回复
热议问题