postgreSQL function call packet

蓝咒 提交于 2019-12-10 23:49:54

问题


As postgreSQL documentation says about it's packets here a function call must send a packet with 'F' identifier to server.

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?


回答1:


That is a misunderstanding.

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.

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.

If you want to see F packets with Wireshark, you have to write C code and use the PQfn function.



来源:https://stackoverflow.com/questions/39469637/postgresql-function-call-packet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!