pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedAllowing John to Drop Triggers On Chad's Tables
4+ messages / 3 participants
[nested] [flat]
* Allowing John to Drop Triggers On Chad's Tables
@ 2021-03-15 19:20 Fred Habash <fmhabash@gmail.com>
2021-03-15 19:33 ` Re: Allowing John to Drop Triggers On Chad's Tables David G. Johnston <david.g.johnston@gmail.com>
2021-03-15 21:10 ` Re: Allowing John to Drop Triggers On Chad's Tables Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 4+ messages in thread
From: Fred Habash @ 2021-03-15 19:20 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
Based on my research, There are the options I have identified to allow user
'John' to drop a trigger on a table owner by 'Chad' ..
1. Make John a superuser
2. grant chad to john ;
3. Have Chad create a wrapper definer-rights procedure to drop triggers &
grant execute to John.
4. Give John Chad's password!
None of these options appeal to me. If there is a 'grant trigger' why is
there not a 'grant drop trigger'?
Any other options since Chad has one table to allow John to drop triggers
on?
----------------------------------------
Thank you
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Allowing John to Drop Triggers On Chad's Tables
2021-03-15 19:20 Allowing John to Drop Triggers On Chad's Tables Fred Habash <fmhabash@gmail.com>
@ 2021-03-15 19:33 ` David G. Johnston <david.g.johnston@gmail.com>
1 sibling, 0 replies; 4+ messages in thread
From: David G. Johnston @ 2021-03-15 19:33 UTC (permalink / raw)
To: Fred Habash <fmhabash@gmail.com>; +Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
On Mon, Mar 15, 2021 at 12:20 PM Fred Habash <fmhabash@gmail.com> wrote:
> If there is a 'grant trigger' why is there not a 'grant drop trigger'?
>
>
Because creating a trigger from scratch doesn't let you affect other
triggers that you may not own (at least not directly). If drop permissions
were grantable the user could drop any trigger attached to said table. The
missing feature here is that triggers should probably have their own
ownership separate from a trigger and a trigger can only be attached to a
table where the trigger owner has trigger permissions. But the trigger
owner can always drop their owned triggers.
> Any other options since Chad has one table to allow John to drop triggers
> on?
>
>
Option 3 is the one that is expected to be used here. Well, aside from the
"John the person asks Chad the person to drop the trigger".
David J.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Allowing John to Drop Triggers On Chad's Tables
2021-03-15 19:20 Allowing John to Drop Triggers On Chad's Tables Fred Habash <fmhabash@gmail.com>
@ 2021-03-15 21:10 ` Tom Lane <tgl@sss.pgh.pa.us>
2021-03-16 16:12 ` Re: Allowing John to Drop Triggers On Chad's Tables Fred Habash <fmhabash@gmail.com>
1 sibling, 1 reply; 4+ messages in thread
From: Tom Lane @ 2021-03-15 21:10 UTC (permalink / raw)
To: Fred Habash <fmhabash@gmail.com>; +Cc: pgsql-general@lists.postgresql.org
Fred Habash <fmhabash@gmail.com> writes:
> Based on my research, There are the options I have identified to allow user
> 'John' to drop a trigger on a table owner by 'Chad' ..
I guess the big-picture question is why do you think you need that?
The separate TRIGGER permission is something we consider obsolescent.
It's difficult to make use of it in any way that isn't tantamount to
giving John the ability to execute arbitrary code as Chad (the next
time Chad does anything with his table). So while a case could be
made that granting TRIGGER should include the right to alter or drop
existing triggers, it's unlikely that anyone will want to expend effort
in that direction.
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Allowing John to Drop Triggers On Chad's Tables
2021-03-15 19:20 Allowing John to Drop Triggers On Chad's Tables Fred Habash <fmhabash@gmail.com>
2021-03-15 21:10 ` Re: Allowing John to Drop Triggers On Chad's Tables Tom Lane <tgl@sss.pgh.pa.us>
@ 2021-03-16 16:12 ` Fred Habash <fmhabash@gmail.com>
0 siblings, 0 replies; 4+ messages in thread
From: Fred Habash @ 2021-03-16 16:12 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-general@lists.postgresql.org
Thank you all for taking the time to respond. As always, great community
support.
On Mon, Mar 15, 2021 at 5:10 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Fred Habash <fmhabash@gmail.com> writes:
> > Based on my research, There are the options I have identified to allow
> user
> > 'John' to drop a trigger on a table owner by 'Chad' ..
>
> I guess the big-picture question is why do you think you need that?
>
> The separate TRIGGER permission is something we consider obsolescent.
> It's difficult to make use of it in any way that isn't tantamount to
> giving John the ability to execute arbitrary code as Chad (the next
> time Chad does anything with his table). So while a case could be
> made that granting TRIGGER should include the right to alter or drop
> existing triggers, it's unlikely that anyone will want to expend effort
> in that direction.
>
> regards, tom lane
>
--
----------------------------------------
Thank you
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2021-03-16 16:12 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-03-15 19:20 Allowing John to Drop Triggers On Chad's Tables Fred Habash <fmhabash@gmail.com>
2021-03-15 19:33 ` David G. Johnston <david.g.johnston@gmail.com>
2021-03-15 21:10 ` Tom Lane <tgl@sss.pgh.pa.us>
2021-03-16 16:12 ` Fred Habash <fmhabash@gmail.com>
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