什么是“数据”在postgresql中的含义?

发布于 2025-01-25 13:20:36 字数 431 浏览 1 评论 0原文

我继承了在PostgreSQL中创建查询的任务,但我对此并不特别熟悉。我一直在研究留下的一些现有查询,但我遇到了这一点:

select data -> 'Fields' ->> 'name', p.* from table_1 as p
join table_2 as cr on cr.id = p.entity_id
where p.entity_id = 'series-of-numbers-and-characters'

我对其余查询在做什么有一个模糊的了解,但是在这种情况下,世界上“数据”的意思是什么?这不是一列。这不是桌子。

我在dbeaver中看到它以蓝色突出显示,因此我可以说它具有某种特殊含义。正确的?搜索“ PostgreSQL数据”和类似的重新介绍在措辞的乏味和通用方面无济于事。 “数据”到底是什么意思?它对查询有什么作用?

I've inherited the task of creating a queries in PostgreSQL but I'm not particularly familiar with it. I've been looking at some of the existing queries that were left behind and I came across this:

select data -> 'Fields' ->> 'name', p.* from table_1 as p
join table_2 as cr on cr.id = p.entity_id
where p.entity_id = 'series-of-numbers-and-characters'

I have a vague idea of what the rest of the query is doing, but what in the world does "data" mean in this context? It's not a column. It's not a table.

I see in DBeaver that it's highlighted in blue, so I can tell it has some sort of special meaning. Right? Searching for "postgresql data" and similar rephrasing is absurdly unhelpful in how bland and generic the wording is. What exactly does "data" mean here? What is it doing to the query?

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

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

发布评论

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

评论(1

尘曦 2025-02-01 13:20:36

自从我在PostgreSQL中使用JSON数据以来已经有一段时间了,但是如果我正确阅读您的查询,则“数据”只是查询中的一个表中的一个表中的JSON或JSONB类型列(如果我必须去的话,则表_2猜测)。该查询是作为JSON的JSON对象的“字段”成员提取的,以“数据”为代表,然后从作为文本提取的“名称”成员提取。

It's been a while since I've worked with JSON data in PostgreSQL, but if I'm reading your query right, "data" is just a json or jsonb type column in one of the tables in the query (table_2 if I had to guess). The query is extracting as JSON the 'Fields' member of the json object represented by "data", then from that extracting as text the 'name' member.

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