Postgres drop table syntax error

后端 未结 2 1592
长发绾君心
长发绾君心 2020-12-18 19:37

Postgres 9.3.2 on heroku.

Pretty sure I\'m just being an idiot, but I can\'t seem to figure out why my syntax is wrong.

db=> \\dt
              Li         


        
2条回答
  •  伪装坚强ぢ
    2020-12-18 20:34

    User is a reserved keyword in Postgres. You'll have to put it in quotes if you want to refer to an actual table named user:

    DROP TABLE "user";

    Probably best to stay away from using reserved keywords as table names if you can help it. It usually ends up creating weird problems down the road. Users might be a better name for a table.

提交回复
热议问题