DBI 的 column_info 与带引号的标识符上的 pgAdmin

发布于 2024-07-07 14:19:54 字数 136 浏览 7 评论 0原文

我的 Postgres 数据库中有一个表,其中包含名为“type”、“desc”和“start”的列。 当我调用 $dbh->column_info 时,只有“desc”返回被引用,而在 pgAdmin 中,所有三个都被引用。 其中之一是错误的吗?

I have a table in my Postgres database with columns named "type", "desc", and "start". When I call $dbh->column_info, only "desc" comes back quoted, whereas in pgAdmin all three of them are quoted. Is one of them wrong?

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

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

发布评论

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

评论(1

旧时光的容颜 2024-07-14 14:19:54

我想我已经回答了我自己的问题,但我想我应该把它放在这里,以防有人有更多的见解。 保留列表显示“desc”是唯一的实际上是保留关键字(另外两个:“我们将解析器明确已知但允许作为列名或表名的那些关键字分类为“非保留”),所以我的猜测是 pgAdminIII 很谨慎并在案例“类型”和“开始”有一天会被保留。

I think I kind of answered my own question, but I thought I'd put it on here in case anyone has more insight. The reserve list shows "desc" is the only actually reserved keyword (the other two: 'we classify as "non-reserved" those key words that are explicitly known to the parser but are allowed as column or table names'), so my guess is that pgAdminIII is being cautious and quoting in case "type" and "start" become reserved some day.

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