Re: Feature request(?): Proxy User

From: Alicja Kucharczyk <zaledwie10minut(at)gmail(dot)com>
To: Mateusz Henicz <mateuszhenicz(at)gmail(dot)com>
Cc: Wiwwo Staff <wiwwo(at)wiwwo(dot)com>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Feature request(?): Proxy User
Date: 2022-07-28 14:02:00
Message-ID: CAM=sWa6cTFoUFF-6MNuzKGfTMXG=CfFQojUDhGC1FFfv1U6KnQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

czw., 28 lip 2022 o 14:18 Mateusz Henicz <mateuszhenicz(at)gmail(dot)com>
napisał(a):

> Hi,
> Did you check "SET SESSION AUTHORIZATION" or "SET ROLE" commands?
> I think that is what you are looking for.
>
> Cheers,
> Mateusz
>
> czw., 28 lip 2022 o 11:29 Wiwwo Staff <wiwwo(at)wiwwo(dot)com> napisał(a):
>
>> Sorry to post solutions and links about alternative DBMSs, but I miss
>> this sort of "sudo" ad database user level:
>> https://oracle-base.com/articles/misc/proxy-users-and-connect-through
>>
>> Is there any approach to achieve the same result in Postgresql?
>> Anyone sharing the need of this functionality?
>>
>> Tnx!
>>
>>
Can you elaborate what exact problem are you trying to solve here?

looking at the article you sent:
"Some DBA tasks, like creating private database links or setting up jobs
using the DBMS_JOB package, require the administrator to log in as a
specific user. This can present a problem if the administrator doesn't know
the password."

probably as Mateusz mentioned SET ROLE is the solution, if you are looking
for something more sophisticated you might want to look what INHERIT
attribute means:
https://www.postgresql.org/docs/current/role-membership.html or look at
functions with security definer:
https://www.postgresql.org/docs/current/sql-createfunction.html

"You have multiple developers working in a shared schema. Letting multiple
people share the same credentials represents a security risk. Instead you
create a separate proxy user for each individual, allowing them to connect
to the schema owner with their own credentials. If a user leaves a project,
you simply lock or drop their user, and they no longer have access to the
shared schema."

It's totally not needed in Postgres as the architecture and the concept of
schema and users is different and you don't have any credentials to the
schema, which is just a namespace in postgres

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter J. Holzer 2022-07-28 18:03:09 Re: Was my question inappropriate for postgres?
Previous Message Tom Lane 2022-07-28 13:51:23 Re: pg_dump query failed