# Audit trail on database postgres

**URL:** <https://forums.percona.com/t/audit-trail-on-database-postgres/24109>\
**Category:** PostgreSQL\
**Tags:** percona, postgres, new-release, postgresql\
**Created:** [August 1, 2023, 3:58pm UTC](https://forums.percona.com/t/audit-trail-on-database-postgres/24109 "2023-08-01T15:58:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![khaled\_ghazy](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/khaled_ghazy/32/11532_2.png) [@khaled\_ghazy](https://forums.percona.com/u/khaled_ghazy)\
**Post date:** [August 1, 2023, 3:58pm UTC](https://forums.percona.com/t/audit-trail-on-database-postgres/24109/1 "2023-08-01T15:58:43Z")

</div>

how can enable audit trail on postgres to audit users and queries that run on database  
i have enable log\_statment to all and install pg\_audit  
but how can i select this data from table like audit trail on oracle database  
i need help for this urgent

---

<div class="post-metadata">

**Author:** ![Shivam\_Dhapatkar](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/shivam_dhapatkar/32/8774_2.png) [@Shivam\_Dhapatkar](https://forums.percona.com/u/Shivam_Dhapatkar)\
**Post date:** [August 3, 2023, 3:52pm UTC](https://forums.percona.com/t/audit-trail-on-database-postgres/24109/2 "2023-08-03T15:52:05Z")

</div>

Hello,

You’ll need to set the auditing parameters according to your requirement in the postgresql.conf file.  
Refer to the Settings section of this https://github.com/pgaudit/pgaudit page for more details about the pgaudit parameter settings.

Next, You will see the pgaudit auditing logs in the Postgres default log directory.

Thanks.
