Thread

  1. Who altered the database?

    Durumdara <durumdara@gmail.com> — 2021-04-09T11:14:17Z

    Dear Members!
    
    We have a server.
    Because of high usage we can't log DDL-s. There are too many temporary
    tables created by users, so it would slow down the server.
    A database owner changed.
    
    What can we do to get info about the change (who did it, from what IP, when
    it happened) in the future?
    
    As I see we can't define precisely what we want to log... All or nothing.
    
    Do you know any tricks to do it?
    
    For example: DB level trigger, or other thing?
    
    Thank you for the answer!
    
    Best regards
    
    dd
    
  2. Re: Who altered the database?

    Ron Johnson <ronljohnsonjr@gmail.com> — 2021-04-09T15:56:12Z

    On 4/9/21 6:14 AM, Durumdara wrote:
    > Dear Members!
    >
    > We have a server.
    > Because of high usage we can't log DDL-s. There are too many temporary 
    > tables created by users, so it would slow down the server.
    > A database owner changed.
    >
    > What can we do to get info about the change (who did it, from what IP, 
    > when it happened) in the future?
    >
    > As I see we can't define precisely what we want to log... All or nothing.
    >
    > Do you know any tricks to do it?
    >
    > For example: DB level trigger, or other thing?
    
    pg_audit?
    
    -- 
    Angular momentum makes the world go 'round.
    
    
    
    
  3. Re: Who altered the database?

    Ganesh Korde <ganeshakorde@gmail.com> — 2021-04-09T17:00:39Z

    On Fri, 9 Apr 2021, 4:44 pm Durumdara, <durumdara@gmail.com> wrote:
    
    > Dear Members!
    >
    > We have a server.
    > Because of high usage we can't log DDL-s. There are too many temporary
    > tables created by users, so it would slow down the server.
    > A database owner changed.
    >
    > What can we do to get info about the change (who did it, from what IP,
    > when it happened) in the future?
    >
    > As I see we can't define precisely what we want to log... All or nothing.
    >
    > Do you know any tricks to do it?
    >
    > For example: DB level trigger, or other thing?
    >
    > Thank you for the answer!
    >
    > Best regards
    >
    > dd
    >
    >
    >
    You can use different options in log_line_prefix parameter in
    postgresql.conf
    You can also log connection and disconnection, each has separate parameter
    in configuration file.
    
    Regards,
    Ganesh Korde.
    
    >
    
  4. Re: Who altered the database?

    Vincent Veyron <vv.lists@wanadoo.fr> — 2021-04-11T15:03:41Z

    On Fri, 9 Apr 2021 13:14:17 +0200
    Durumdara <durumdara@gmail.com> wrote:
    > 
    > What can we do to get info about the change (who did it, from what IP, when
    > it happened) in the future?
    > 
    > As I see we can't define precisely what we want to log... All or nothing.
    > 
    
    Create a web interface to apply the changes and have the web server log the info in its own logs?
    
    Apache has this directive :
    
    https://httpd.apache.org/docs/2.4/mod/mod_log_config.html#logformat
    
    -- 
    					Bien à vous, Vincent Veyron 
    
    https://marica.fr/ 
    Logiciel de suivi des contentieux juridiques, des sinistres d'assurance et des contrats