Stephen Frost <sfr...@snowman.net> writes: > * Jacob Champion (pchamp...@vmware.com) wrote: >> I propose that every auth method should store the string it uses to >> identify a user -- what I'll call an "authenticated identity" -- into >> one central location in Port, after authentication succeeds but before >> any pg_ident authorization occurs. This field can then be exposed in >> log_line_prefix. (It could additionally be exposed through a catalog >> table or SQL function, if that were deemed useful.) This would let a >> DBA more easily audit user activity when using more complicated >> pg_ident setups.
> This seems like it would be good to include the CSV format log files > also. What happens if ALTER USER RENAME is done while the session is still alive? More generally, exposing this in log_line_prefix seems like an awfully narrow-minded view of what people will want it for. I'd personally think pg_stat_activity a better place to look, for example. > on every log line... I wonder if we should be focusing on a similar > approach for other pg_ident.conf use-cases instead of having it via > log_line_prefix, as the latter means we'd be logging the same value over > and over again on every log line. Yeah, this seems like about the most expensive way that we could possibly choose to make the info available. regards, tom lane