#1032·pgroll

Setting search_path assumes database clients have access to migration schemas

Author: orpheusxCreated May 11, 2026Updated May 11, 2026
Labelsdocumentationquestion

My application defines four schemas with seven non-login roles that grant varying combinations of privilege to the tables in one or more of the schemas. Different parts of the application connect to the database as one of four different "users" (login roles) that have been granted one or more of the non-login roles. The goal is to limit each database connection to give it only the access level it needs. From what I've understood, this is the recommended practice for good security.

The search_path solution recommended by the pgroll docs seems to assume that the connection client roles will have access to the new schemas and views created by pgroll using the database superuser. For any application that follows the separation-of-privilege practice, however, this will not be the case. Am I missing something that pgroll's designers assumed or didn't document? I can write a wrapper script to extrapolate and execute the needed grants but didn't want to reinvent the wheel if there's an approach that makes it unnecessary.