PostgreSQL – Logging All Queries

logpostgresql

I am using Postgres as my Database. I need to know whether I can extract all the queries that got executed with out logging them as logging all the queries will degrade the performance of database. So, provide a way I can get all the queries that got executed with out logging the queries.

Best Answer

If not logging the queries, there is no chance. However, if you are looking for some statistics to find e.g. queries which are executed very often and therefore an optimization could make sense: Checkout pg_stat_statment-extension