postgresql 中名为parent 的列

发布于 2024-10-31 13:22:27 字数 465 浏览 0 评论 0原文

postgresql 是否允许名为“parent”的列?

也不

SELECT id, parent, name FROM address WHERE id=1

SELECT id, "parent", name FROM address WHERE id=1

我实际的结果。相反,我得到:

ERROR:  column "parent" does not exist
LINE 1: SELECT id, "parent", name FROM address WHERE id=1
                   ^
In statement:
SELECT id, "parent", name FROM address WHERE id=1

该表肯定有一个名为parent 的列。

Does postgresql allow columns named "parent"?

Neither

SELECT id, parent, name FROM address WHERE id=1

nor

SELECT id, "parent", name FROM address WHERE id=1

give me an actual result. Instead I get:

ERROR:  column "parent" does not exist
LINE 1: SELECT id, "parent", name FROM address WHERE id=1
                   ^
In statement:
SELECT id, "parent", name FROM address WHERE id=1

The table very certainly has a column called parent.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

水波映月 2024-11-07 13:22:27

“parent”一词似乎不是关键字 在 postgresql 中,所以还有其他问题。

当用双引号引起来列名称时,列名称将区分大小写。你能发布“\d地址”的输出吗?这将有助于诊断问题。

The word "parent" does not appear to be a keyword in postgresql so something else is the issue.

When you surround the column name with double-quotes, the column name becomes case sensitive. Can you post the output of "\d address"? This would be helpful in diagnosing the issue.

眼藏柔 2024-11-07 13:22:27

这实际上是相当阴险的。没有任何问题。整个问题是 APC 缓存保留了它不应该保留的东西。很抱歉造成混乱。

It was actually quite insidious. There was nothing wrong with anything. The whole issue was the APC cache holding onto something it shouldn't have. Sorry about the confusion.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文