2017-02-22 44 views
-2

我使用下面的查詢:誤差en eliminacion去llave foranea - 錯在下降外鍵的PostgreSQL

alter table hlt_citas drop constraint Ref_hlt_citas_to_hlt_atencion; 

當我查詢表的結構,外鍵的部分如下:

"Ref_hlt_citas_to_hlt_atencion" FOREIGN KEY (cod_atencion) 
REFERENCES hlt_atencion(cod_atencion) ON UPDATE CASCADE ON DELETE RESTRICT 

但是,當我運行查詢它告訴我,它不存在。

回答

0

當使用雙引號給出列名或約束名稱等標識符時,標識符將區分大小寫。然後,您還應該在查詢中使用雙引號以保持區分大小寫:

alter table hlt_citas drop constraint "Ref_hlt_citas_to_hlt_atencion";