[英]psql column doesn't exist but it does
I am trying to select a single column in my data table using raw SQL in a postgresql database from the psql command line. 我试图在psql命令行的postgresql数据库中使用原始SQL在我的数据表中选择一个列。 I am getting an error message that says the column does not exist.
我收到一条错误消息,指出该列不存在。 Then it gives me a hint to use the exact column that I referenced in the select statement.
然后它给我一个提示,使用我在select语句中引用的确切列。 Here is the query:
这是查询:
SELECT insider_app_ownershipdocument.transactionDate FROM insider_app_ownershipdocument;
Here is the error message: 这是错误消息:
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".
I have no idea why this is not working. 我不知道为什么这不起作用。
(Postgres) SQL converts names automatically to lower case although it support case-sensitive names. (Postgres)SQL将名称自动转换为小写,尽管它支持区分大小写的名称。 So
所以
SELECT insider_app_ownershipdocument.transactionDate FROM insider_app_ownershipdocument;
will be aquivalent to: 将符合以下条件:
SELECT insider_app_ownershipdocument.transactiondate FROM insider_app_ownershipdocument;
You should protect the column name with double quotes to avoid this effect: 您应该使用双引号保护列名称以避免此效果:
SELECT insider_app_ownershipdocument."transactionDate" FROM insider_app_ownershipdocument;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.