postgresql 关系不存在

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16763736/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 00:56:24  来源:igfitidea点击:

Relation does not exist

postgresqlpowerbuilderdatawindow

提问by user2423106

I have just connected Powerbuilder with PostgreSQL through ODBC, but something goes wrong when I'm trying to create a datawindow! I can't understand where is the problem. I will be so grateful to receive any answers.

我刚刚通过 ODBC 将 Powerbuilder 与 PostgreSQL 连接起来,但是当我尝试创建数据窗口时出了点问题!我无法理解问题出在哪里。收到任何答复,我将不胜感激。

The error:

错误:

Cannot create DataWindow

SQLSTATE=42P01
ERROR:relation "core sample" does not exist;

No query has been executed with that handle

SELECT CORE_SAMPLE.N_CORE,      CORE_SAMPLE.DEPTH,

CORE_SAMPLE.WELL_ID_WELL,   CORE_SAMPLE.ID_CORE FROM 

CORE_SAM'
Cannot create DataWindow

SQLSTATE=42P01
ERROR:relation "core sample" does not exist;

No query has been executed with that handle

SELECT CORE_SAMPLE.N_CORE,      CORE_SAMPLE.DEPTH,

CORE_SAMPLE.WELL_ID_WELL,   CORE_SAMPLE.ID_CORE FROM 

CORE_SAM'

回答by Erwin Brandstetter

Obviously, there is a mixup with names. "core sample"is not the same as CORE_SAMPLE. Hard to say more, based on what little information we have here.

显然,名称存在混淆。"core sample"不一样CORE_SAMPLE。很难说更多,基于我们这里的信息很少。

Unquoted identifiers are cast to lower casein PostgreSQL, so CORE_SAMPLE, Core_Sampleor core_sampleend up to be identical.
But once you enclose identifiers in double quotes, the name is preserved as is. This way you can have otherwise illegal characters like a space in the name: "core sample". My standing advise is to stay away form that and use legal, lower case identifiers exclusively with PostgreSQL.

未加引号的标识符在 PostgreSQL中被转换为小写,因此CORE_SAMPLE, Core_Sampleorcore_sample最终是相同的。
但是,一旦将标识符括在双引号中,名称将按原样保留。这样您就可以在名称中包含其他非法字符,例如空格:"core sample"。我的长期建议是远离这种情况,只在 PostgreSQL 中使用合法的小写标识符。

The error message tells you there is no table named "core sample", at least not in the database you connected to in any of the schemas listed in the search_path.
But the displayed query refers to a table named CORE_SAMPLEwhich does not match this error message.

错误消息告诉您没有名为 的表"core sample",至少在您连接的数据库中没有在search_path.
但是显示的查询引用了一个CORE_SAMPLE与此错误消息不匹配的表。