2015-10-15 30 views
0

顯示我有奇怪的問題,當我做Postgres的:表是使用 d但顯示語法錯誤而刪除表

`temp=# \d 
         List of relations 
Schema |    Name    | Type |  Owner  
--------+-------------------------------+----------+----------------- 
public | ORDER       | table | admin 
public | ORDER_id_seq     | sequence | admin ` 

如表列表如上圖所示。表名ORDER快到了,但是當我嘗試刪除它,我得到的語法錯誤,如
temp=# drop table ORDER; ERROR: syntax error at or near "ORDER" LINE 1: drop table ORDER;

問題是什麼,什麼是其他的方式來降ORDER表?

回答

1

由於ORDER也是SQL「保留字」,你必須把表名在雙引號。 (無論如何你必須這樣做,因爲它是大寫的)