pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christoph Moench-Tegeder <cmt@burggraben.net>
To: Dominique Devienne <ddevienne@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: DEFINER / INVOKER conundrum
Date: Mon, 3 Apr 2023 14:59:03 +0200
Message-ID: <ZCrNl0h+5vS/m9Nc@squirrel.exwg.net> (raw)
In-Reply-To: <CAFCRh-86dC08WJ-FW+Hn4i6p1bNuPnSPnaD8PnOZ36siR0VhDw@mail.gmail.com>
References: <CAFCRh-86dC08WJ-FW+Hn4i6p1bNuPnSPnaD8PnOZ36siR0VhDw@mail.gmail.com>

## Dominique Devienne (ddevienne@gmail.com):

> On the one hand, I want a INVOKER security function,
> to be able to capture the login and current ROLEs.

There's session_user ("the session user's name") which remains unchanged
on a SECURITY DEFINER function, and current_user ("the user name of the
current execution context") which changes according to the security
context set by SECURITY DEFINER/INVOKER.
-> https://www.postgresql.org/docs/current/functions-info.html

Regards,
Christoph

-- 
Spare Space.





view thread (6+ messages)  latest in thread

Message-ID: <ZCrNl0h+5vS/m9Nc@squirrel.exwg.net>
Permalink:  ../ZCrNl0h+5vS%2Fm9Nc@squirrel.exwg.net/
Also on:    postgresql.org/message-id/ZCrNl0h+5vS/m9Nc@squirrel.exwg.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: cmt@burggraben.net, ddevienne@gmail.com
  Subject: Re: DEFINER / INVOKER conundrum
  In-Reply-To: <ZCrNl0h+5vS/m9Nc@squirrel.exwg.net>
  References: <CAFCRh-86dC08WJ-FW+Hn4i6p1bNuPnSPnaD8PnOZ36siR0VhDw@mail.gmail.com> <ZCrNl0h+5vS/m9Nc@squirrel.exwg.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox