Database audit / Associating a statement with connection - Mailing list pgsql-admin

From Ben Kim
Subject Database audit / Associating a statement with connection
Date
Msg-id Pine.GSO.4.10.10502251150350.9049-100000@edsun.coe.tamu.edu
Whole thread Raw
Responses Re: Database audit / Associating a statement with connection
List pgsql-admin
I have some questions and would like help.

(1) Audit practice
Is there a good source of information about audit for postgresql
databases?

Specifically I'd like some advice on these:

(2) Associating a statement with a database connection

I'm logging statements and connections, but it seems the statement is not
associated with the connection in the log.

- log_connections = true
- log_statement = true

    connection received: host=128.91.23.43 port=35644
    query: SELECT ID, ....

Is there a way to associate them so I know which statement came from which
connection?

(3) Associating a web connection with a database connection

Also, if I have a web frontend for the database, what would be the best
practice to associate a statement with a particular web client IP?

For example, I have in the postgresql log
    connection received: host=128.91.23.43 port=35644
where 128.91.23.43 is my web server.

The web server log records all client connections and accessed pages, but
I don't have a good method of associating the web client connections with
the database client connections.

I'd appreciate any pointers.


Regards,

Ben Kim
Database Developer/Systems Administrator
434E Harrington Tower / College of Education
Texas A&M University




pgsql-admin by date:

Previous
From: Naomi Walker
Date:
Subject: Re: Postgresql on Solaris versus Linux
Next
From: Tom Lane
Date:
Subject: Re: Database audit / Associating a statement with connection