Re: Is there anyway for non-superuser to log all sql statements at the session level? - Mailing list pgsql-admin

From Scott Ribe
Subject Re: Is there anyway for non-superuser to log all sql statements at the session level?
Date
Msg-id B2D5A861-5FF0-4CB0-90B9-A6422EB0D470@elevated-dev.com
Whole thread Raw
In response to Re: Is there anyway for non-superuser to log all sql statements at the session level?  (Hotmail <crajac66@hotmail.com>)
List pgsql-admin
> On Sep 9, 2021, at 9:18 PM, Hotmail <crajac66@hotmail.com> wrote:
>
> Thanks for the suggestion. We currently use pgaudit at the database level for all ddL. Unfortunately, you must be a
superuserto change pgaudit  settings at the session level. Our desire is to capture the ddl/dml for a specific session.
Capturing the dml at the database level with pgaudit would generate too much logging with our application user. Our
migrationsscripts are all checked into a git repo.  
>
> We would like to get specific timestamp/timing info for each migration ddl/dml statement as it is executed. May not
bepossible in postgres for a non-superuser. We recently migrated off Oracle and we were able to do this as a
non-superuserwith session tracing but we are not aware similar capabilities in postgres. 

Can't you use a single-purpose user to run migration scripts, and pgaudit to log everything that user does?







pgsql-admin by date:

Previous
From: Hotmail
Date:
Subject: Re: Is there anyway for non-superuser to log all sql statements at the session level?
Next
From: hubert depesz lubaczewski
Date:
Subject: Re: Blank page