Re: Proposal: SET ROLE hook

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: Proposal: SET ROLE hook
Date: 2016-03-01 10:09:08
Message-ID: CAFj8pRBKHqhX=JRC6YHvhFpWy1HZ9h1+RrDqY_hQf=ndRkHy2w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

2016-02-29 2:40 GMT+01:00 Joe Conway <mail(at)joeconway(dot)com>:

> On 01/07/2016 09:08 AM, Joe Conway wrote:
> > On 01/06/2016 10:36 AM, Tom Lane wrote:
> >> I think a design that was actually somewhat robust would require two
> >> hooks, one at check_role and one at assign_role, wherein the first one
> >> would do any potentially-failing work and package all required info into
> >> a blob that could be passed through to the assign hook.
>
> Attached.
>

These patches are pretty trivial, and I can confirm so all regress tests
are passed.

I see following issues:

1. Missing the possibility to pass custom data from SetRoleCheck_hook to
SetRoleAssign_hook. Tom mentioned it in his comment.

2. Missing little bit more comments and an explanation why and when to use
these hooks.

Regards

Pavel

>
> Joe
>
> --
> Crunchy Data - http://crunchydata.com
> PostgreSQL Support for Secure Enterprises
> Consulting, Training, & Open Source Development
>

Attachment Content-Type Size
setrole_hook-2016.03.01.00.diff text/plain 2.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tobias Florek 2016-03-01 11:04:27 WHERE clause not used when index is used
Previous Message Stas Kelvich 2016-03-01 09:31:57 transam README small fix