Re: passing linux user to PG server as a variable ? - Mailing list pgsql-general

From David G. Johnston
Subject Re: passing linux user to PG server as a variable ?
Date
Msg-id CAKFQuwYk6wu093RQ1PD2csgJ_Tg5X-2emMjPpvGqRqFgCAf6zg@mail.gmail.com
Whole thread Raw
In response to Re: passing linux user to PG server as a variable ?  (David Gauthier <davegauthierpg@gmail.com>)
List pgsql-general
On Mon, Aug 17, 2020 at 5:46 PM David Gauthier <davegauthierpg@gmail.com> wrote: 
Users will connect to the DB and then update a table using SQL at the prompt.  And I want a post update trigger to identify who (linux user on the client side) just made that change.    I was sort of hoping that this 8 character string (the linux user id) could be passed from client -> server as a parameter that is set on the user/client side, perhaps using that "-v" option, which could somehow be passed along to the server. 

If you are giving a user a direct connection to the DB so they can run SQL they should have their own individual credentials.

Regardless, if you rely on runtime variables there is no way to prevent the value of those variables from being changed by the user.

David J.

pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: passing linux user to PG server as a variable ?
Next
From: Edson Richter
Date:
Subject: "Go" (lang) standard driver