pgBadger may also be useful for you. It analyzes logs and creates graphs of query traffic.
http://dalibo.github.io/pgbadger/
From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of David G. Johnston
Sent: Friday, October 27, 2017 8:59 AM
To: Syed Asim Shah <asim.shah@telenor.com.pk>
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] SQL history.
Dear Team,
We are having POSGRESQL version 9.6 installed on OS version Linux REDHAT 7.2. How we can fetch historical SQL executions trend of last 24 hours.
For possibilities. Neither are installed/configured/enabled by default to capture the information you seek.
The contents of this e-mail message and
any attachments are intended solely for the
addressee(s) and may contain confidential
and/or legally privileged information. If you
are not the intended recipient of this message
or if this message has been addressed to you
in error, please immediately alert the sender
by reply e-mail and then delete this message
and any attachments. If you are not the
intended recipient, you are notified that
any use, dissemination, distribution, copying,
or storage of this message or any attachment
is strictly prohibited.