postgresql - xpath(未知,字符不同)不存在
问题描述
我正在尝试从 PostgreSQL 表事件数据中获取一些数据
Table public.incidents_data
Column | Type | Modifiers | Storage | Stats target | Description
-----------+-------------------------+-----------+----------+--------------+-------------
mib_name | character varying(64) | | extended | |
timestamp | bigint | not null | plain | |
node_id | bigint | not null | plain | |
id | bigint | not null | plain | |
xml_data | character varying(4096) | | extended | |
cause | character varying(128) | | extended | |
数据位于 xml_data 列中,具有以下 XML 布局。
<Incident>
<ExtraInformation>
<SslState>error</SslState>
<RemoteLocalTuple>Remote Ip:Port 1.1.1.1:46537 <---> Local Ip:Port 2.2.2.2:5061</RemoteLocalTuple>
</ExtraInformation>
<StandardInfo>
<Cause>error:14094415:SSL routines:ssl3_read_bytes:sslv3 alert certificate expired</Cause>
<MIBName>ipcsTlsHandshakeFailure</MIBName>
<Timestamp>1594933477674</Timestamp>
<IncidenceId>797466738837365</IncidenceId>
<Source>source-server</Source>
</StandardInfo>
</Incident>
尝试使用 xpath 获取 RemoteLocalTuple 数据,如下所示。
select xpath('/mydefns:Incident/mydefns:ExtraInformation/mydefbs:RemoteLocalTuple', xml_data) from incidents_data where mib_name='ipcsTlsHandshakeFailure';
select xpath('//Incidents/ExtraInformation/RemoteLocalTuple/text()',xml_data) from incidents_data where mib_name='ipcsTlsHandshakeFailure';
我在 xpath 命令上遇到错误。
错误:函数 xpath(未知,字符变化)不存在
提示:没有函数匹配给定的名称和参数类型。您可能需要添加显式类型转换。
服务器正在运行 psql (PostgreSQL) 9.4.21,并且在服务器上安装了 libxml2 库。
我是否以错误的方式使用 xpath 函数?
解决方案
推荐阅读
- angular7 - 没有 SqPaymentForm 如何用卡数据调用 cardNonceResponseReceived?
- java - Spark找不到依赖项
- android - 存储 Firestore 数据模型的最佳实践
- c# - 吸引给定点周围的对象而不重叠
- excel - 多个外部工作簿的 Worksheet_Change 事件
- reporting-services - 在不同组矩阵的每个实例之间显示矩阵
- javascript - ii 有可能在 firebase 存储中获得多少元素?
- artifactory - 我可以使用 webdav , davfs2 将相同的工件存储库安装到 100 多台机器上吗
- javascript - jQuery 单击使用 jQuery 的按钮并在 ajax 成功后将数据附加到响应
- mysql - SELECT COUNT(复杂查询中的空闲房间类别)