无法在postgreSQL中输入raw_parser?

发布于 2024-12-11 04:46:17 字数 257 浏览 0 评论 0原文

我正在尝试分析 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 技术交流群。

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

发布评论

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

评论(1

尽揽少女心 2024-12-18 04:46:17

如果您使用 printf(stderr, "...."),那么您可以在服务器日志中找到结果。不要忘记 - 您不是直接与服务器一起工作。出于调试目的,有一个 elog 函数 - 它就像客户端应用程序的 printf:

elog(NOTICE, "some text");

格式字符串与 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:

elog(NOTICE, "some text");

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.

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