I have a PostgreSQL DB at my computer and I have an application that runs queries on it.
How can I see which queries has run on my DB?
I use a Linux computer and pgadmin.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Turn on the server log:
This will log every call to the database server.
I would not use
log_statement = allon a production server. Produces huge log files.The manual about logging-parameters:
Resetting the
log_statementparameter requires a server reload (SIGHUP). A restart is not necessary. Read the manual on how to set parameters.Don’t confuse the server log with pgAdmin’s log. Two different things!
You can also look at the server log files in pgAdmin, if you have access to the files (may not be the case with a remote server) and set it up correctly. In pgadmin III, have a look at:
Tools -> Server status. That option was removed in pgadmin4.I prefer to read the server log files with
vim(or any editor / reader of your choice).