Re: SET ROLE and search_path

2020-05-20 Thread Stephen Frost
Greetings, * Tom Lane (t...@sss.pgh.pa.us) wrote: > Rob Sargent writes: > > Am I (again) alone in finding this a bit hokey?  That a user name just > > happens to be a schema name ... > > That's actually strongly encouraged by the SQL spec, if memory serves. ... and all-but-required by some oth

Re: SET ROLE and search_path

2020-05-20 Thread Tom Lane
Rob Sargent writes: > Am I (again) alone in finding this a bit hokey?  That a user name just > happens to be a schema name ... That's actually strongly encouraged by the SQL spec, if memory serves. regards, tom lane

Re: SET ROLE and search_path

2020-05-20 Thread Patrick FICHE
ql.org Objet : Re: SET ROLE and search_path I have this exact setup, and I use roles / schema names that match so the $user var works with the search path when I set role as my application user. > When search_path contains “$user”, does it refer to session_user or > current_user ? It uses

Re: SET ROLE and search_path

2020-05-20 Thread Rob Sargent
On 5/20/20 1:28 PM, Adam Brusselback wrote: I have this exact setup, and I use roles / schema names that match so the $user var works with the search path when I set role as my application user. > When search_path contains “$user”, does it refer to session_user or current_user ? It uses cur

Re: SET ROLE and search_path

2020-05-20 Thread Adam Brusselback
I have this exact setup, and I use roles / schema names that match so the $user var works with the search path when I set role as my application user. > When search_path contains “$user”, does it refer to session_user or current_user ? It uses current_user, not session_user. Works perfectly with s

Re: SET ROLE and search_path

2020-05-20 Thread Rob Sargent
On 5/20/20 10:36 AM, Patrick FICHE wrote: Hi, I’m trying to implement a PostgreSQL multi-tenant database that will be accessed by a Web Application. The users that will login will belong to different companies and a schema was created in the database for each company. However, I would l

SET ROLE and search_path

2020-05-20 Thread Patrick FICHE
Hi, I'm trying to implement a PostgreSQL multi-tenant database that will be accessed by a Web Application. The users that will login will belong to different companies and a schema was created in the database for each company. However, I would like the Web Application to connect with a single Po