I'm using an ORM in my app and would like to see all statements sent to Postgres so that I can figure out exactly what the ORM is doing. In the Postgres config file I added
log_statement = 'all' to get logging of statements to work, but it puts them in the same log file as all the other things like
CET DETAIL, etc. Is it possible to get a separate log file showing only the statements that Postgres receives?
Even better is it possible to exclude statements sent to Postgres from command like psql, so that I can see exactly what my app is sending to the DB?
Also I'm not sure what exactly is being sent to Postgres, because sometimes in the log file statements appear prefixed with
CET STATEMENT: and other times with
CET LOG: statement:. What's the difference between these? Sometimes they appear one after another with the same SQL statement so I'm not sure if that means it was run twice or just once.