[英]psql column doesn't exist but it does
我試圖在psql命令行的postgresql數據庫中使用原始SQL在我的數據表中選擇一個列。 我收到一條錯誤消息,指出該列不存在。 然后它給我一個提示,使用我在select語句中引用的確切列。 這是查詢:
SELECT insider_app_ownershipdocument.transactionDate FROM insider_app_ownershipdocument;
這是錯誤消息:
ERROR: column insider_app_ownershipdocument.transactiondate does not exist
SELECT insider_app_ownershipdocument.transactionDate FROM in...
HINT: Perhaps you meant to reference the column "insider_app_ownershipdocument.transactionDate".
我不知道為什么這不起作用。
(Postgres)SQL將名稱自動轉換為小寫,盡管它支持區分大小寫的名稱。 所以
SELECT insider_app_ownershipdocument.transactionDate FROM insider_app_ownershipdocument;
將符合以下條件:
SELECT insider_app_ownershipdocument.transactiondate FROM insider_app_ownershipdocument;
您應該使用雙引號保護列名稱以避免此效果:
SELECT insider_app_ownershipdocument."transactionDate" FROM insider_app_ownershipdocument;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.