PostrgeSQL 9.1 Certificate Authentication: how to get certificate common name of client?
I am using [Certificate Authentication][1] for clients on a PostgreSQL 9.1 database server. Several certificate common names are mapped to a single database user in [pg_ident.conf][2]. 

I do not want to create a database user for each certificate because it is easier to manage accepted certificates with pg_ident.conf. But now I need some query to map a backend process to the common name used for the connection. Is there a way to get the common name (CN field) of the certificate with which a user connected to the database?


  [1]: http://www.postgresql.org/docs/9.1/static/auth-methods.html#AUTH-CERT
  [2]: http://www.postgresql.org/docs/9.1/static/auth-username-maps.html
PostrgeSQL 9.1 Certificate Authentication: how to get certificate common name of client?
===

I am using [Certificate Authentication][1] for clients on a PostgreSQL 9.1 database server. Several certificate common names are mapped to a single database user in [pg_ident.conf][2]. 

I do not want to create a database user for each certificate because it is easier to manage accepted certificates with pg_ident.conf. But now I need some query to map a backend process to the common name used for the connection. Is there a way to get the common name (CN field) of the certificate with which a user connected to the database?


  [1]: http://www.postgresql.org/docs/9.1/static/auth-methods.html#AUTH-CERT
  [2]: http://www.postgresql.org/docs/9.1/static/auth-username-maps.html