无法在postgreSQL中输入raw_parser?
我正在尝试分析 postgreSQL 如何解析查询,并且在通过到处嵌入 printf() 进行一些 postgreSQL 源代码跟踪之后,我知道该查询将使用 raw_parser 解析为原始解析树,它位于文件解析器中.c.
奇怪的是,我已经在 raw_parser 中嵌入了 printf() 虚拟对象,并且在重新安装 postgreSQL 并执行查询后,我的 printf() 虚拟对象没有打印到屏幕上!
有人可以帮我吗,我哪里出错了?
预先感谢:D
I'm trying to analyze how postgreSQL parse a query, and after some postgreSQL source code tracing with embedding printf() here and there, I've known that the query will be parsed into raw parse tree with raw_parser, which located in file parser.c.
The strange thing is, I've already embedded a printf() dummy in the raw_parser, and after re-installing the postgreSQL and execute a query, my printf() dummy is not printed to the screen!
Can anybody please help me, where I went wrong?
Thanks in advance :D
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用 printf(stderr, "...."),那么您可以在服务器日志中找到结果。不要忘记 - 您不是直接与服务器一起工作。出于调试目的,有一个 elog 函数 - 它就像客户端应用程序的 printf:
格式字符串与 printf 的格式相同 - 但您必须记住,PostgreSQL 使用与 glibc 不同的格式 - 因此您可以仅显示整数或浮点变量。字符串变量使用与 C 零完成字符串不同的格式。
if you use printf(stderr, "...."), then you can find result in server log. Don't forget - you are not work with server directly. For debugging purposes there are a elog function - it's like printf for client application:
a format string is same like printf's format - but you must to remember, PostgreSQL uses a different formats than glibc - so you can to show only integer or float variables. String variables uses different format than is C zero finished string.