In SQL Server when we have applications for which we do not have source code we could use the SQL Server profiler to analyze which queries or procedures are called when we do something in the application. Now I have similar situation with a .NET third party library and a Postgres database when it would be very useful to track queries called by that library. I found something similar in pgAdmin, but so far it appears to be useful to track only SQL queries that are executed in pgAdmin, not queries from external applications.
So to sum up: Is there a tool that allows me to track queries executed on a Postgres database from external applications?
EDIT: I tried to select from pg_stat_activity
, but when I expect to see which stored procedures or statement is executed it prints only "COMMIT" string in the "query" column.
pg_stat_activity
only shows the most recent statement that was executed, it does not show the history of all statements