Re: pgaudit - an auditing extension for PostgreSQL - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pgaudit - an auditing extension for PostgreSQL
Date
Msg-id 26537.1415047994@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgaudit - an auditing extension for PostgreSQL  (Abhijit Menon-Sen <ams@2ndQuadrant.com>)
List pgsql-hackers
Abhijit Menon-Sen <ams@2ndQuadrant.com> writes:
> Earlier, I was using a combination of check and assign hooks to convert
> names to OIDs, but (as Andres pointed out) that would have problems with
> cache invalidations. I was even playing with caching membership lookups,
> but I ripped out all that code.

> In the attached patch, role_is_audited does all the hard work to split
> up the list of roles, look up the corresponding OIDs, and check if the
> user is a member of any of those roles. It works fine, but it doesn't
> seem desirable to repeat all that work for every statement.

> So does anyone have suggestions about how to make this faster?

Have you read the code in acl.c that caches lookup results for
role-is-member-of checks?  Sounds pretty closely related.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Abhijit Menon-Sen
Date:
Subject: Re: pgaudit - an auditing extension for PostgreSQL
Next
From: Peter Eisentraut
Date:
Subject: Re: how to handle missing "prove"