DarkCoffee
DarkCoffee

Reputation: 950

Debugger database application and queries

Can a debugger let me see the queries that the application does? For example if I have a database application (written in C or in Java) that connect itself to postgresql, can gdb show me the statments inside the program? Thank you

Upvotes: 1

Views: 95

Answers (1)

Employed Russian
Employed Russian

Reputation: 213506

can gdb show me the statments inside the program?

Yes, but you'll need to find a place in the database server where that info is conveniently available, and set a breakpoint there.

It's possible that the client library turns the query and parameters into a packed structure of some sort before sending it to the server, and the info may not be conveniently available on the server side at all. But that's not very likely, as the server probably has ability to log the queries.

Upvotes: 1

Related Questions