Re: passing linux user to PG server as a variable ?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: David Gauthier <davegauthierpg(at)gmail(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: passing linux user to PG server as a variable ?
Date: 2020-08-18 01:08:23
Message-ID: CAKFQuwYk6wu093RQ1PD2csgJ_Tg5X-2emMjPpvGqRqFgCAf6zg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Aug 17, 2020 at 5:46 PM David Gauthier <davegauthierpg(at)gmail(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Edson Richter 2020-08-18 03:55:55 "Go" (lang) standard driver
Previous Message David G. Johnston 2020-08-18 01:03:11 Re: passing linux user to PG server as a variable ?