public inbox for [email protected]
help / color / mirror / Atom feedFrom: David G. Johnston <[email protected]>
To: Nicolas Mitchell <[email protected]>
Cc: hubert depesz lubaczewski <[email protected]>
Cc: pgsql-novice <[email protected]>
Subject: Re: Trigger function
Date: Tue, 27 Jul 2021 17:46:54 -0700
Message-ID: <CAKFQuwY72k5ngAb+XXwKjBDtqhmqjDXPoAfYGv6AxGXTCsM3NQ@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
<CAKFQuwazmQBDYdt+zcw2WV+3bONRjbe7qoHiMnREYj+VRXEXjA@mail.gmail.com>
<[email protected]>
<CAKFQuwY-1SH+2aGbceazDw+MvrBLC1raD951vBA7LivE2QmNzQ@mail.gmail.com>
<[email protected]>
On Tue, Jul 27, 2021 at 5:41 PM Nicolas Mitchell <[email protected]>
wrote:
> If within PG, then
> I’d view that as something I should explore. Otherwise, I’m not
> keen, at present, to push things into an application when they can be
> achieved within PG - this being my own (fairly uneducated) preference.
>
>
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.
David J.
view thread (11+ messages) latest in thread
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: Trigger function
In-Reply-To: <CAKFQuwY72k5ngAb+XXwKjBDtqhmqjDXPoAfYGv6AxGXTCsM3NQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox