O'Reilly logo

PostgreSQL 9 Administration Cookbook - Second Edition by Simon Riggs, Gianni Ciolli, Hannu Krosing, Gabriele Bartolini

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Mapping external usernames to database roles

When using certificate authentication, as described in the previous recipe, or any other external or single sign-on system authentication method from http://www.postgresql.org/docs/9.4/static/auth-methods.html (GSSAPI, SSPI, Kerberos, Radius, or PAM), you often have different usernames in the external system and your database. Or, you may just need to enable some externally authenticated user to connect as multiple database users.

Getting ready

Prepare a list of usernames from the external authentication system and decide which database users they are allowed to connect as—that is, which external users map to which database users.

How to do it…

Create a pg_ident.conf file in the usual place (PGDATA), with ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required