Unanswered: Discover which command was sent to postgreSQL
I'm new here, so forgive me if I'm asking an old question.
I'm developing a new app but I need to use the same database that the current app uses. So I need to map the queries the old app do. Like this: if I click on "search products" I need to discover how this query was sent to the database, like "SELECT...". Is there a command i can use in postgresql to do that?
If you have access to the database config files, you can configure your server to log many different things, including SQL statements.
in postgresql.conf, look at the log_statement setting. The possible choices are none (default,) ddl, mod (dml,) and all. You'll have to reload the configuration file after changing it.
If there are a lot of people 'hitting' the database concurrently though, your log files can get quite large.
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert