I am using Postgresql 9.4. How can I find what queries were running or who were logged in say 2 hous ago in Postgresql?
Also, is there any other postgres forums where I can ask question?
I am using Postgresql 9.4. How can I find what queries were running or who were logged in say 2 hous ago in Postgresql?
Also, is there any other postgres forums where I can ask question?
select * from pg_stat_activity
shows you sessions (and queries). But real time only. You can cron
saving those stat to other table, or enable logging level to save statements and connections to logs. But pg itself does not do that...