postgreSQL函数调用包 [英] postgreSQL function call packet
问题描述
如postgreSQL文档所述,此处函数调用必须向服务器发送带有'F'
标识符的数据包。
As postgreSQL documentation says about it's packets here a function call must send a packet with 'F'
identifier to server.
所以我定义了一个简单的函数,在监视我的连接端口之后,使用 select
语句调用了它wirehark 我看不到识别出的'F'
数据包,只有多个简单查询数据包(识别出了'Q'
)。
So I defined a simple function and called it with select
statement and after monitoring my connection port using wireshark I see no 'F'
identified packet, just multiple simple query packets ('Q'
identified).
我在这里错过了什么吗?
Am I missing something here?
推荐答案
在 SELECT
语句内调用的函数是查询(标识符 Q
)或 Parse (标识符 P
)消息。
A function that is called inside a SELECT
statement is part of the statement text in a Query (identifier Q
) or a Parse (identifier P
) message.
您所引用的文档部分描述了该消息 快速路径界面 。这是从前端到后端协议支持准备好的语句并用于执行简单的函数调用之前的剩余时间,而无需解析SQL语句。现在它已过时,但仍在一些地方使用,例如 large对象API 。
The part of the documentation you are referring describes the message for the fast-path interface. This is a leftover from the time before the frontend-backend protocol had support for prepared statements and was used to execute a simple function call without the overhead of having to parse an SQL statement. It is mostly obsolete now, but still used in a few places like the large object API.
如果您想通过Wireshark查看 F
个数据包,必须编写C代码并使用 PQfn
函数。
If you want to see F
packets with Wireshark, you have to write C code and use the PQfn
function.
这篇关于postgreSQL函数调用包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!