Re: get user info on log

2022-09-17 Thread Adrian Klaver
On 9/16/22 06:00, Marcos Pegoraro wrote: Em qui., 15 de set. de 2022 às 12:59, Adrian Klaver mailto:adrian.kla...@aklaver.com>> escreveu: test(5432)=# set role maura; ERROR:  role "maura" does not exist test(5432)=# SET SESSION AUTHORIZATION 'maura'; ERROR:  role "maura" does no

Re: get user info on log

2022-09-17 Thread Adrian Klaver
On 9/16/22 19:22, Ganesh Korde wrote: Hi,   You can use log_line_prefix in postgresql.conf to log the user name into the logs. That uses the session user, the user that established the connection. What the OP is after is the role name that is set by SET ROLE or SET SESSION AUTHORIZATION.

Re: get user info on log

2022-09-16 Thread Ganesh Korde
Hi, You can use log_line_prefix in postgresql.conf to log the user name into the logs. Regards, Ganesh Korde. On Fri, 16 Sep 2022, 6:31 pm Marcos Pegoraro, wrote: > Em qui., 15 de set. de 2022 às 12:59, Adrian Klaver < > adrian.kla...@aklaver.com> escreveu: > >> test(5432)=# set role maura;

Re: get user info on log

2022-09-16 Thread Marcos Pegoraro
Em qui., 15 de set. de 2022 às 12:59, Adrian Klaver < adrian.kla...@aklaver.com> escreveu: > test(5432)=# set role maura; > ERROR: role "maura" does not exist > test(5432)=# SET SESSION AUTHORIZATION 'maura'; > ERROR: role "maura" does not exist > > No, I was asking about an error occurring late

Re: get user info on log

2022-09-15 Thread Adrian Klaver
On 9/13/22 12:45, Marcos Pegoraro wrote: When using set role or set session authorization and an error occurs I get user name which logged in and not the one I´ve changed to. There is a way to get session_user and current_user on log ? When I do: test(5432)=# set role maura; ERROR: role "ma

get user info on log

2022-09-13 Thread Marcos Pegoraro
When using set role or set session authorization and an error occurs I get user name which logged in and not the one I´ve changed to. There is a way to get session_user and current_user on log ? Thanks Marcos