0

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?

snowrock
  • 161
  • 1
  • 1
  • 8

1 Answers1

0

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...

Community
  • 1
  • 1
Vao Tsun
  • 47,234
  • 13
  • 100
  • 132