Re: Trigger function

From: "Nicolas Mitchell" <mitchelln(at)posteo(dot)net>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "hubert depesz lubaczewski" <depesz(at)depesz(dot)com>, pgsql-novice <pgsql-novice(at)lists(dot)postgresql(dot)org>
Subject: Re: Trigger function
Date: 2021-07-28 00:49:48
Message-ID: 5EA2BFB2-6A89-4402-8F8E-898EF0BB8D20@posteo.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On 28 Jul 2021, at 1:46, David G. Johnston wrote:

> I'd probably do "CREATE PROCEDURE create_new_host(new_host_name text,
> new_host_domain integer) ... SECURITY DEFINER"
>
> Then grant permission to call that procedure to roles that need to create
> new host records. Your original CTE would then be executed within the
> procedure. Roles would not be given permission to insert directly into the
> host or related tables - but the owner of the procedure would.
>

Okay, that’s something I can get my teeth into.

Many thanks,

Nic

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Roger Mason 2021-08-20 10:38:07 plpgsql select into
Previous Message David G. Johnston 2021-07-28 00:46:54 Re: Trigger function