Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Postgresql 一个查询运行良好,但一个非常类似的查询根本不运行_Postgresql_Quoted Identifier - Fatal编程技术网

Postgresql 一个查询运行良好,但一个非常类似的查询根本不运行

Postgresql 一个查询运行良好,但一个非常类似的查询根本不运行,postgresql,quoted-identifier,Postgresql,Quoted Identifier,我已经使用SQL很多年了,但我对postgresql还是相当陌生的。我正在使用pgAdmin,我正在运行下面的查询 select * from budget_spending where market is not null limit 10 但是,此查询不会运行 select * from budget_spending where Project_Description is not null limit 10 我收到以下错误消息: ERROR: column "projec

我已经使用SQL很多年了,但我对postgresql还是相当陌生的。我正在使用pgAdmin,我正在运行下面的查询

select *
from budget_spending
where market is not null
limit 10
但是,此查询不会运行

select *
from budget_spending
where Project_Description is not null
limit 10
我收到以下错误消息:

ERROR:  column "project_description" does not exist

这很奇怪,因为我正在看它,它确实存在。如果右键单击该列并转到“属性”,则会看到“项目描述”作为该列的名称。我遗漏了什么?

可能是安全问题。是否可能列已锁定,或者我没有运行此类查询的权限?我是从SQL Server后台来到这里的。我从未在SQL Server上见过这种安全性。事实证明,我不得不在冒犯性的列名周围加上双引号。当列名中没有空格时,这似乎有点奇怪。哦,好吧。现在我知道了。除非列名是双引号,否则Postgres会转换成小写(与指定大写的SQL标准相反)。似乎定义表的人都想在名称中保持大写。但是,一旦创建了双引号,所有引用也必须使用双引号。感谢您提供的信息!!真的很感激!!!!